-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Add X-Forwarded-For header name #32171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Why? We have middleware that already translates this into the appropriate values. |
This is useful when creating own http calls to other services, to not have magic strings, but reference to one source of truth ie |
@@ -370,4 +370,5 @@ static readonly Microsoft.Net.Http.Headers.HeaderNames.WWWAuthenticate -> string | |||
static readonly Microsoft.Net.Http.Headers.HeaderNames.Warning -> string! | |||
static readonly Microsoft.Net.Http.Headers.HeaderNames.WebSocketSubProtocols -> string! | |||
static readonly Microsoft.Net.Http.Headers.HeaderNames.XFrameOptions -> string! | |||
static readonly Microsoft.Net.Http.Headers.HeaderNames.XForwardedFor -> string! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be in PublicAPI.Unshipped.txt
not Shipped
tldr; add header name `X-Forwarded-For` as constant in `HeaderNames` static class.
Thank you for submitting this for API review. This will be reviewed by @dotnet/aspnet-api-review at the next meeting of the ASP.NET Core API Review group. Please ensure you take a look at the API review process documentation and ensure that:
|
@dotnet/aspnet-api-review, I flagged this PR because I want to discuss and document what our policy is for adding constants to a list like this. |
@DenisBalan we reviewed this and decided to add a written policy for what should and should not be added to this list. See https://github.com/dotnet/aspnetcore/pull/32394/files. Based on that policy I'm going to close this PR. Thanks for bringing this to our attention. |
tldr; add header name
X-Forwarded-For
as constant inHeaderNames
static class.more info https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For