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

Choose Rack headers class depending on availability #76

Merged
merged 1 commit into from
Feb 21, 2024
Merged

Choose Rack headers class depending on availability #76

merged 1 commit into from
Feb 21, 2024

Conversation

davidrunger
Copy link
Contributor

@davidrunger davidrunger commented Feb 20, 2024

closes #75

Rack 3.0.0 deprecates Rack::Utils::HeaderHash, warns that the class will be removed in Rack 3.1, and suggests using Rack::Headers, instead. This change uses the Rack::Headers class, if it is defined (i.e. if rack >= 3.0.0 is installed), and otherwise falls back to using Rack::Utils::HeaderHash (i.e. for rack < 3.0.0).

Rack 3.0.0 deprecates Rack::Utils::HeaderHash, warns that the class will
be removed in Rack 3.1, and suggests using Rack::Headers, instead. This
change uses the Rack::Headers class, if it is defined (i.e. if rack >=
3.0.0 is installed), and otherwise falls back to using
Rack::Utils::HeaderHash (i.e. for rack < 3.0.0).
@davidrunger
Copy link
Contributor Author

I tested this change against my app using both Rack 3.0.9 (in which case this forked branch of rails-reverse-proxy used Rack::Headers) and also locking my app to Rack 2.2.8 (in which case it used Rack::Utils::HeaderHash). In both cases, rails-reverse-proxy worked perfectly (for my app's needs/usage).

davidrunger added a commit to davidrunger/david_runger that referenced this pull request Feb 20, 2024
@axsuul axsuul merged commit 1703143 into axsuul:master Feb 21, 2024
@axsuul
Copy link
Owner

axsuul commented Feb 21, 2024

Thanks! Released as 0.13.0

@davidrunger
Copy link
Contributor Author

@axsuul Thank you so much for the quick merge and release! 🚀

It's an honor to have been added to the CHANGELOG and to the README. ☺️ Thank you for that, as well! 🙇‍♂️

@davidrunger davidrunger deleted the rack-headers-class-depending-on-availability branch August 24, 2024 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rack 3.x compatibility
2 participants