[Catalyst] Resurrected: HTTP redirect - delayed Firefox

John Napiorkowski jjn1056 at yahoo.com
Fri Feb 23 23:26:06 GMT 2007



----- Original Message ----
From: Andy Grundman <andy at hybridized.org>
To: The elegant MVC web framework <catalyst at lists.rawmode.org>
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


_______________________________________________
List: Catalyst at lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
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



More information about the Catalyst mailing list