Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

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

#958

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.

Reported by Jonathan del Strother · September 2nd, 2008 @ 05:42 PM

State: resolved
Milestone: 2.x
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: none

Activity

  1. Repository
    Repository
    • State changed from new to resolved

    (from [6cfb70023a7b102debaa7f1505b173556a285ae7]) Don't set Content-Length on 304 responses

    Commit 8aad8c claimed to do this, but it checks for the 304 status too early, before handle_conditional_get! has overridden it.

    [#958 [PATCH] Don't set Content-Length on 304 responses state:resolved]

    Signed-off-by: Jonathan del Strother jon.delStrother@bestbefore.tv Signed-off-by: Jeremy Kemper jeremy@bitsweat.net http://github.com/rails/rails/co...

    September 2nd, 2008 @ 10:39 PM