support lower case x-cascade headers in the router #47108
Closed
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.
Motivation / Background
As part of the change in the spec for Rack for Rack 3.0 - the headers are now expected to be lower case.
This was updated in sprockets in rails/sprockets#758, but when using the
X-Cascade
header we are currently checking a case sensitive version which causes the cascade to fail, as identified in #47096.This PR updates the logic for detecting the cascade header to be case insensitive and fixes #47096.
Detail
This Pull Request changes the detection of the
X-Cascade
header in the router to be case insensitive.Additional information
The implementation may be able to be simplified using the
ActionDispatch::Response::Header
once #47091 is merged, but I am not sure of the timing for when that would be merged, and we may want to backport a fix for this issue without needing to backport #47091.Checklist
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
I think that this is a minor bug fix - so I have not included a CHANGELOG entry. I am happy to add one if you think it is required.