----- Original Message ---- From: John Napiorkowski <[EMAIL PROTECTED]> To: The elegant MVC web framework <[email protected]> Sent: Friday, February 23, 2007 6:26:06 PM Subject: Re: [Catalyst] Resurrected: HTTP redirect - delayed Firefox
----- Original Message ---- From: Andy Grundman <[EMAIL PROTECTED]> To: The elegant MVC web framework <[email protected]> Sent: Friday, February 23, 2007 5:40:29 PM Subject: Re: [Catalyst] Resurrected: HTTP redirect - delayed Firefox On Feb 23, 2007, at 5:27 PM, Andy Grundman wrote: > > On Feb 23, 2007, at 5:04 PM, Svilen Ivanov wrote: > >> But the Engine::HTTP doesn't provide the Content-Length. This can >> be fixed >> by adding a few lines in finalize_headers (Engine/HTTP.pm, at line >> 53): >> if ($self->_keep_alive) { >> $c->response->headers->content_length( length($c->response- >> >body) ); >> } > > Hmm, Content-Length should already be set elsewhere in the code, in > Catalyst::finalize_headers. Actually, redirects don't have any body or content-length (see Catalyst.pm line 1415), so according to the RFC, will cause the browser to not reuse the connection. Not sure if this helps but according to the specification HTTP 302 should contain a body entity: "The temporary URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s)." I can see that Catalyst is setting a Content_length for HTTP 303 (which has no delay issue for me) but doesn't set one for HTTP 302, which does. I don't think this would be too hard to test, could just manually insert the content length in the view code, just to see --john Woot, looks like that fixed it! Firefox seems to want a content length. If I add a line to my end action to make sure that 302 has a content length header I don't get the delay anymore. How do we want to go about fixing this? Should we make sure that 302 follows the spec as outlined above (sets a body with the redirect link if one doesn't already exist), create a test patch etc? --john _______________________________________________ List: [email protected] Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/ ____________________________________________________________________________________ Need a quick answer? Get one in minutes from people who know. Ask your question on www.Answers.yahoo.com _______________________________________________ List: [email protected] Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/ ____________________________________________________________________________________ Never Miss an Email Stay connected with Yahoo! Mail on your mobile. Get started! http://mobile.yahoo.com/services?promote=mail _______________________________________________ List: [email protected] Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
