-
Notifications
You must be signed in to change notification settings - Fork 10.4k
support ForwardedHeaders configuration #61419
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
base: main
Are you sure you want to change the base?
support ForwardedHeaders configuration #61419
Conversation
@halter73 could you please spare some time on this? Looking forward to your input, thanks very much |
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.
Pull Request Overview
This PR adds support for configuring ForwardedHeaders options through application configuration, allowing developers to specify custom forwarded headers, known networks, and known proxies via configuration rather than only through code.
- Extends
ForwardedHeadersOptionsSetup
to read additional configuration values for headers, networks, and proxies - Adds parsing logic to handle comma-separated configuration values for forwarded headers and network/proxy collections
- Includes a new test to verify custom headers configuration works correctly
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
File | Description |
---|---|
src/DefaultBuilder/src/ForwardedHeadersOptionsSetup.cs | Adds configuration-based setup for forwarded headers, known networks, and known proxies with parsing logic |
src/DefaultBuilder/test/Microsoft.AspNetCore.Tests/WebHostTests.cs | Adds test coverage for custom forwarded headers configuration |
Support ForwardedHeaders configuration
Description
Support configure default forwarded headers/knownNetworks/KnownProxies from configuration
Fixes #57017