Add AppContext switch in patch release to opt-out of breaking behavior change in ForwardedHeaders middleware #62690
+28
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add AppContext switch in patch release to opt-out of breaking behavior change in ForwardedHeaders middleware.
Description
We previously fixed a bug where
KnownProxies
andKnownNetworks
weren't being applied in common cases. We didn't realize at the time this would break many customers apps.The workaround is to configure
KnownProxies
andKnownNetworks
, which is intended, and our docs do state that users should configure these. But due to the bug we recently fixed, users didn't need to configure those options for the app to work.We're adding an app context switch to opt-out of the breaking change and go back to the previous behavior. This gives users the option to update their app code at a more convenient time, e.g. when 10.0 releases.
Customer Impact
Customers have noticed that updating to the latest patch breaks scenarios like Https redirection and auth flows due to the X-Forwarded-Proto header not being applied anymore.
Regression?
2.3.4, 8.0.17, 9.0.6
Change was made on purpose to harden security, but didn't realize it would cause a regression.
Risk
Just adding an app context switch. Test coverage added for the switch as well.
Verification
Packaging changes reviewed?
When servicing release/2.1