You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!
First of all, thank you for the great enricher!
I tried to handle forwarded headers in the latest version (v2.1.0, net8, win11) using ForwardedHeadersMiddleware and it seems it doesn't work properly. Looks like the updated by ForwardedHeadersMiddleware value of HttpContext.Connection.RemoteIpAddress property is ignored by ClientIpEnricher:
RemoteIpAddress and XForwardedFor properties contain the expected value "1.2.3.4", but HttpContext.Items["Serilog_ClientIp"] and as the result ClientIp property both have "::1".
The text was updated successfully, but these errors were encountered:
Thanks for reporting the issue. You’re right. For the first time before the middleware sets the IP, the enricher logs the IP and caches the IP address log property in HttpConext, and it will be used for the rest of the logs in a request. I will fix it.
Could you please review the PR if you have time? #40
Please keep in mind that always the first client IP log would be "unknown" or "::1" before the middleware sets the IP.
Hello!
First of all, thank you for the great enricher!
I tried to handle forwarded headers in the latest version (v2.1.0, net8, win11) using ForwardedHeadersMiddleware and it seems it doesn't work properly. Looks like the updated by ForwardedHeadersMiddleware value of HttpContext.Connection.RemoteIpAddress property is ignored by ClientIpEnricher:
If I send a GET request with X-Forwarded-For: "1.2.3.4" header I can see the following log message:
RemoteIpAddress and XForwardedFor properties contain the expected value "1.2.3.4", but HttpContext.Items["Serilog_ClientIp"] and as the result ClientIp property both have "::1".
The text was updated successfully, but these errors were encountered: