-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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
Removed the single space character for Safari #14883
Conversation
Thanks for tackling this. Great to rid ourselves of cruft no longer needed. On Apr 27, 2014, at 8:43 PM, Godfrey Chan notifications@github.com wrote:
|
👍 Should update these tests rather than removing them. We expect these to return an empty (unpadded) body. |
should I close #14350 then? or should we go ahead with both? |
I haven't dug too deep into the fix itself, I'll take a look at #14350 and pull it whatever we need 👍 Just want to get the test case up and have other people check it! On Sun, Apr 27, 2014 at 2:53 PM, Arthur Nogueira Neves
|
I've been trying to judge how likely a Mac user is to still be using Safari 3.0 and 2.0. The data: So... Also... 🎉 I think we can declare that bug fixed. 🎉 |
I agree that we don't really have to worry about safari < 5. My motivation for testing this on a broken version of safari is to verify the correctness of the test cases and make sure it's testing against the right bug. Now that I have a test case that passes everywhere it could either be that the bug is fixed everywhere, or the test case is completely wrong :) I am betting on the former, but it would be nice to know for sure |
`render nothing: true` or rendering a `nil` body no longer add a single space to the response body. The old behavior was added as a workaround for a bug in an early version of Safari, where the HTTP headers are not returned correctly if the response body has a 0-length. This is been fixed since and the workaround is no longer necessary. Use `render body: ' '` if the old behavior is desired.
Removed the single space character for Safari
- The single space response was added due to a bug in safari in rails@cb0f8fd and rails@807df4f. - This was removed from the `render nothing: true` in rails#14883. - Removing it from response of :head also. As :head is more obvious alternative to call `render nothing: true`(http://guides.rubyonrails.org/layouts_and_rendering.html#using-head-to-build-header-only-responses), removing it from head method also. - Closes rails#18253.
I'm still cleaning up the tests, but I want to get this out so people can help me test itOnce upon a time, a single space character was added to
render nothing: true
(cb0f8fd, 807df4f) to fix a bug in Safari. (Thank you @matthewd for hunting this down.)Since this bug has been fixed in Safari itself a long time ago (based on the timestamps it should be fixed in Safari 2.x or perhaps 1.x in ~2005), it's probably a good time to remove this.
I wrote a simplified version of the webkit test case which you can access here:
(The controller doesn't actually use
render nothing
, but it should have the same effect)I tested this on a variety of browsers on [browser stack(http://www.browserstack.com/)], including Safari 4.0 and Firefox 3.0 and it seems to work fine.
Ideally, I'd like to see this test case fail on an older version of safari (you might need safari 2.0 or even 1.0). If you have access to one of those super old browser, please help run the test case and let me know what happens 😄
Otherwise, I am fairly confident that this should be okay.
cc @dhh @jeremy @sikachu @matthewd
Fixes #14336