This project is archived and is in readonly mode.

#958 ✓resolved
Jonathan del Strother

[PATCH] Don't set Content-Length on 304 responses

Reported by Jonathan del Strother | September 2nd, 2008 @ 05:42 PM | in 2.x

Heya

8aad8cb3906fce40fa583839fec7f8591fab8ec7 changed things so that 304 responses no longer have a content length of 0. This is probably a good thing : I suspect that 304s should not have a Content-Length header (though I'm struggling to find a definitive answer in the HTTP spec)

Unfortunately, as of that commit, the content length of 304s is set to the content length of the original response.

This causes huge problems when using conditional GETs with Cocoa's NSURLConnection, where it will hang around waiting for the rest of the content length, which will never arrive, and the connection will time out.

The attached patch shuffles the order of the response setup, so that content length is only set after the conditional GETs are handled.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Referenced by

Pages