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
Lowercase headers returned from Sprockets 4.2.0 not caught within Actionpack router #47096
Closed
Labels
Comments
Hmm, based on my read of rails/sprockets#758 it seems like cc @lsylvester |
|
4 tasks
I am using rack 2.2.6.2 - but I don't rely on this cascade behavior in my applications so I haven't run into this. I have added #47108 to fix this issue. |
4 tasks
adrianna-chang-shopify
added a commit
to adrianna-chang-shopify/rails
that referenced
this issue
Jul 28, 2023
This commit changes the router to use the expected casing for the x-cascade header: in Rack 2, this is mixed-case, and in Rack 3, this is lower case. This also fixes rails#47096.
This was referenced Jul 29, 2023
paulreece
pushed a commit
to paulreece/rails-paulreece
that referenced
this issue
Aug 26, 2023
This commit changes the router to use the expected casing for the x-cascade header: in Rack 2, this is mixed-case, and in Rack 3, this is lower case. This also fixes rails#47096.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to reproduce
The Gemlock specifies Sprockets 4.2.0 but this is incompatible with the Actionpack router. In Sprockets 4.2.0, the returned headers were changes to lowercase to support Rack 3, the Actionpack router has case sensitive matching for the
X-Cascade
header which means failed routes don't cascade to other potential matches.Toggle the Sprockets version from 4.2.0 to 4.1.1 below to see the issue.
For a Sprockets application serving from
/assets
and an additional route serving from/assets/some-path
, the latter should still respond after Sprockets has failed to match the route.Expected behavior
Both
X-Cascade
andx-cascade
headers should be matched from Sprockets.Alternatively, Sprockets should be locked to 4.1.1 until this is resolved in Rails.
Actual behavior
X-Cascade header isn't matched and matching routes are missed.
System configuration
Rails version: 7.x & 6.1.x
Ruby version: 3.x
The text was updated successfully, but these errors were encountered: