-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Introduce KestrelServerOptions.AllowUnsafeHostHeaderOverride #48460
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
Thank you for your API proposal. I'm removing the |
src/Servers/Kestrel/test/InMemory.FunctionalTests/BadHttpRequestTests.cs
Outdated
Show resolved
Hide resolved
src/Servers/Kestrel/test/InMemory.FunctionalTests/BadHttpRequestTests.cs
Outdated
Show resolved
Hide resolved
Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime. |
…ost (dotnet#39334) * Allow overriding the host header if doesn't match the absolute-form host * Apply suggestions from code review Co-authored-by: Stephen Halter <[email protected]>
The new public API is `KestrelServerOptions.AllowUnsafeHostHeaderOverride` and I've moved the explanatory comments there. The behavior remains opt-in.
Force push is a rebase |
Co-authored-by: Chris Ross <[email protected]>
Introduce KestrelServerOptions.AllowUnsafeHostHeaderOverride
Make it possible to skip validation that the request-target and host header match.
Description
This builds on #48415 (which is itself a port of #39334). That PR introduced an internal API and corresponding appcontext switch that made it possible to overwrite an incorrect Host header with a value derived from an absolute-form request target to handle the surprisingly common client behavior of missing the line-break after the host header, as IIS/Http.Sys did. This PR upgrades it to a public API since those clients aren't going away. The behavior is the same, it just has a name and a doc comment intended for broader consumption.
Fixes #39335 (with #48415).
Fixes #48461