Skip to content

Commit

Permalink
analizators/s2259
Browse files Browse the repository at this point in the history
  • Loading branch information
SuhorukovAnton committed Dec 30, 2021
1 parent e2857e8 commit 555ca30
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions common/ASC.Core.Common/Context/SecurityContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ public bool AuthenticateMe(string cookie)
if (HttpContextAccessor?.HttpContext != null)
{
var request = HttpContextAccessor?.HttpContext.Request;

if (request == null) throw new ArgumentNullException("request");

ipFrom = "from " + (request.Headers["X-Forwarded-For"].ToString() ?? request.GetUserHostAddress());
address = "for " + request.GetUrlRewriter();
}
Expand Down Expand Up @@ -189,6 +192,9 @@ public bool AuthenticateMe(string cookie)
if (HttpContextAccessor?.HttpContext != null)
{
var request = HttpContextAccessor?.HttpContext.Request;

if (request == null) throw new ArgumentNullException("request");

address = "for " + request.GetUrlRewriter();
ipFrom = "from " + (request.Headers["X-Forwarded-For"].ToString() ?? request.GetUserHostAddress());
}
Expand Down

0 comments on commit 555ca30

Please sign in to comment.