[Javascript] Show a progress bar while waiting for a download to begin?
Nick Fitzsimons
nick at nickfitz.co.uk
Fri Jun 9 11:45:47 CDT 2006
Scott Reynen wrote:
> On Jun 9, 2006, at 11:04 AM, Nick Fitzsimons wrote:
>> Certainly, no browser is going to know what to do with a response with
>> two status lines, as it's a breach of the standard.
>
> Right, but I'm not sure it's a breach of the standard to send a redirect
> 302 along with content. Browsers aren't required to understand every
> status code, only the first digit. So a 302 can be interpreted as a
> 300, and a 300 says:
>
> "user agents MAY use the Location field value for automatic redirection"
Good point, but under 302, the HTTP 1.1 RFC states:
"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)."
So strictly speaking, returning content in a 302 response other than a
link to the target of the redirect is wrong-ish (it's a SHOULD rather
than a MUST). I'd guess that browsers which implement HTTP 1.1 ignore
the content of the response on the grounds that they know how to react
to the 302. Just a guess, and not something I'm going to test
extensively at 17:45 on a Friday :-)
Regards,
Nick.
--
Nick Fitzsimons
http://www.nickfitz.co.uk/
More information about the Javascript
mailing list