Browse Source

Get the client IP address from the reverse proxy

pull/262/head
cKey 5 years ago
parent
commit
9ab462a9f6
  1. 2
      aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.HttpOverrides/LINGYUN/Abp/AspNetCore/WebClientInfo/RequestForwardedHeaderWebClientInfoProvider.cs

2
aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.HttpOverrides/LINGYUN/Abp/AspNetCore/WebClientInfo/RequestForwardedHeaderWebClientInfoProvider.cs

@ -32,7 +32,7 @@ namespace LINGYUN.Abp.AspNetCore.WebClientInfo
if (requestHeaders != null && if (requestHeaders != null &&
requestHeaders.TryGetValue(Options.ForwardedForHeaderName, out StringValues headers) == true) requestHeaders.TryGetValue(Options.ForwardedForHeaderName, out StringValues headers) == true)
{ {
if (StringValues.IsNullOrEmpty(headers)) if (!StringValues.IsNullOrEmpty(headers))
{ {
return headers.Last(); return headers.Last();
} }

Loading…
Cancel
Save