-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Remove Grape::Http::Headers #2554
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
Conversation
Use plain HTTP_ or real header name instead of referencing to Http::Headers:: Remove Grape::Util::Lazy::Object
dblock
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs an UPGRADING on the invalid header that can be set and the removal of some constants.
CHANGELOG.md
Outdated
| * [#2540](https://github.com/ruby-grape/grape/pull/2540): Introduce Params builder with symbolized short name - [@ericproulx](https://github.com/ericproulx). | ||
| * [#2550](https://github.com/ruby-grape/grape/pull/2550): Drop ActiveSupport 6.0 - [@ericproulx](https://github.com/ericproulx). | ||
| * [#2549](https://github.com/ruby-grape/grape/pull/2549): Delegate cookies management to `Grape::Request` - [@ericproulx](https://github.com/ericproulx). | ||
| * [#2554](https://github.com/ruby-grape/grape/pull/2554): Remove Grape::Http::Headers - [@ericproulx](https://github.com/ericproulx). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you have a fix here for #2334, add?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well its a fix .. but not really. We've been using Grape::Util::Header for a while and since then, Grape is compliant with Rack's spec about headers.
Add UPGRADING notes Add X-Access-Token in list of headers
|
Rebase? Feel free to merge yourself. |
* Move HTTP_HEADERS in Grape::Request and renew known headers Use plain HTTP_ or real header name instead of referencing to Http::Headers:: Remove Grape::Util::Lazy::Object * Add few headers * Add other headers * Add other known headers and sort * CHANGELOG.md entry * Fix CHANGELOG.md Add UPGRADING notes Add X-Access-Token in list of headers
This PR removes
Grape::Http::Headers. Since most constantsHTTP_were just literal string and Grape's uses#frozen_string_literal: true, it made sense to just use the literal string wherever needed. Here's a list of notable changes:Grape::Http::Headers::SUPPORTED_METHODShas been moved toGrapemodule.Grape::Http::Headers::HTTP_HEADERShas been moved toGrape::Requestand its now calledKNOWN_HEADERS. The last has been revisited to reflect Rack 3's KNOWN_HEADERS. Its not an exact copy. Grape's version has more.Grape::Util::Lazy::Objectno longer exists. Solely used byGrape::Http::Headers::HTTP_HEADERSGrape::Http::Headers.find_supported_methodno long exists. It wasn't used.to_swhen callingheaderssince its not just a plain{}but aGrape::Util::Headers. Fix Grape allows invalid headers to be set. #2334