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
You might want to add to docs that the CheckForwardedForHeader flag in the AspNetRequestIpLayoutRenderer only works with a header named X-Forwarded-For, and no other headers - or make it configurable in the renderer :)
Again, no urgency (I'm using the same naming as you do here for my forwarded headers).
The text was updated successfully, but these errors were encountered:
Reading it from the ASP.NET Core config:
I think you would have to try to resolve this options type using DI: ForwardedHeadersOptions, and if a registration/configuration of those options is present — use the value of that property. I'm a bit unsure if the app startup fails if you try to resolve an options type that hasn't been configured, so probably would have to handle that gracefully as well.
The drawback of linking it to the ASP.NET Core config: In 2.0/2.1./2.2 this options type is in the Http Overrides nuget, and in 3.0 it's available as part of the framework. I
Maybe it's a bit too much to have NLog.Web.AspNetCore depend on this nuget (for 2.X apps) just for the options wiring..? If it was me, I would probably just have it be configurable and avoid the dependency, but up to you to, really :)
Informational:
This is not an urgent issue, just mentioning it since I stumbled across it.
NLog.Web/NLog.Web.AspNetCore version: Latest
Platform: ASP.NET Core
The X-Forwarded-For headername is hardcoded here, but it's configurable in ASP.NET Core.
You might want to add to docs that the
CheckForwardedForHeader
flag in theAspNetRequestIpLayoutRenderer
only works with a header namedX-Forwarded-For
, and no other headers - or make it configurable in the renderer :)Again, no urgency (I'm using the same naming as you do here for my forwarded headers).
The text was updated successfully, but these errors were encountered: