-
-
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
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
@@ -9,6 +9,7 @@ | |||
* [#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. |
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_METHODS
has been moved toGrape
module.Grape::Http::Headers::HTTP_HEADERS
has been moved toGrape::Request
and 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::Object
no longer exists. Solely used byGrape::Http::Headers::HTTP_HEADERS
Grape::Http::Headers.find_supported_method
no long exists. It wasn't used.to_s
when callingheaders
since its not just a plain{}
but aGrape::Util::Headers
. Fix Grape allows invalid headers to be set. #2334