Skip to content
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

support lower case x-cascade headers in the router #47108

Closed

Conversation

lsylvester
Copy link
Contributor

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:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

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.

@markedmondson
Copy link
Contributor

@rafaelfranca rafaelfranca added this to the 7.1.0 milestone Jan 23, 2023
@rafaelfranca
Copy link
Member

Yes. Let's fix all of them in the same PR.

@lsylvester lsylvester force-pushed the support-lower-case-x-cascade-headers branch from 593f046 to 9f9104d Compare January 23, 2023 22:36
@lsylvester
Copy link
Contributor Author

@rafaelfranca I have updated with a fix for debug exceptions, and also another case in show exceptions. I think that this every instance where the X-Cascade header was being checked in a case-sensitive way.

The lint errors seem to be unrelated - as they appear to be referring to issues within trix which have not been changed as part of this PR, and the failure appears to be affecting other recent PRs.

@lsylvester lsylvester force-pushed the support-lower-case-x-cascade-headers branch from 9f9104d to 97d222e Compare January 23, 2023 23:42
Copy link
Contributor

@ioquatix ioquatix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lowercase headers returned from Sprockets 4.2.0 not caught within Actionpack router
4 participants