-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Update access to rack constant #1917
Conversation
Generated by 🚫 danger |
@@ -213,7 +213,13 @@ def to_xml | |||
context 'no content responses' do | |||
let(:no_content_response) { ->(status) { [status, {}, ['']] } } | |||
|
|||
Rack::Utils::STATUS_WITH_NO_ENTITY_BODY.each do |status| | |||
STATUSES_WITHOUT_BODY = if Rack::RELEASE >= '2.1.0' |
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.
Use Gem::Version.new
to compare, otherwise we're going to be in trouble with version 11.
https://medium.com/little-programming-joys/how-to-compare-version-strings-in-ruby-ced0916a4b71
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.
Sure, I'll fix it.
It's done in this way here: https://github.com/ruby-grape/grape/blob/master/spec/grape/integration/rack_spec.rb#L23 So I've assumed it's how you would want it here too.
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.
That link doesn't go anywhere interesting ;) If you see it done elsewhere, please also fix!
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.
It did until you've merged my other PR :)
But I'll fix this today, thank you
In rack 2.1.0 the list of statuses has become a hash with codes as keys. More info: rack/rack@6746515
Updated as suggested. |
A small fix to keep up with the new changes in rack: rack/rack@6746515#diff-7c1a24d5b2fe58a6f925c7cacc6c55e7L558-R558
The format of the object with the possible statuses has changed in a recent release, which breaks the rack-edge appraisal, so this PR fixes it.