-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Rack changed their status codes to IETF RFC 7231 #20757
Rack changed their status codes to IETF RFC 7231 #20757
Conversation
🍵 I'm gonna miss you 😭 😭 😭 😭 Even though the actual change did not happen in the Rails codebase, it might still break someone's app when updating to Rails 5. I think it might be useful to add a note to the "Upgrade to Rails 5" guide too. Also, it looks like the failing test is not caused by the commit. |
It broke my app when upgrading to Rails 4.2 (4.2 depends on Rack 1.6), so that would probably be the more appropriate upgrade guide to change.
|
a7134f5
to
3e6e6b9
Compare
Added a commit with upgraded 4.2 release notes. |
👍 |
1 similar comment
👍 |
Ping @spastorino who merged rack/rack#754 into Rack master. Sorry if pinging is considered rude 😊 |
@@ -227,6 +227,17 @@ restore the old behavior. | |||
If you do this, be sure to configure your firewall properly such that only | |||
trusted machines on your network can access your development server. | |||
|
|||
### Changed status option symbols for `render` | |||
|
|||
Due to a [change in Rack](https://github.com/tonyta/rack/commit/be28c6a2ac152fe4adfbef71f3db9f4200df89e8), the symbols that the `render` method accepts for the `:status` option have changed: |
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.
You should point to the rack repository here
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.
Whoops, you’re right.
I think we should revert this in Rack 1.6.x and release again and apply only to 2.x. For some reason I thought it was only applied to 2.x. |
It was released in Rack 1.6.0 more than 8 months ago. Isn’t it a bit too late to revert a breaking change? My guess is that a lot of applications have already been changed to work around this change. It would be confusing if they had to change the behavior back the next time they upgrade Rack. |
c073a1d
to
3ec3ac6
Compare
…-rack Rack changed their status codes to IETF RFC 7231
Mind me to update the integration with my PiTeapot... |
Wait, I use I'm a Teapot! :( |
Rails is calling the
Rack::Utils.status_code
method in several places, and calling that method with an unknown symbol will return the integer 500.The valid symbols are defined by the names in
Rack::Utils::HTTP_STATUS_CODES
. And they changed in in rack/rack#754, released in Rack v1.6.0 (see also https://github.com/rack/rack/blob/master/HISTORY.md). This PR changes Rails’ documentation to match the new valid status symbols.Here’s the relevant diff from that Rack PR: