mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
fixes bug 276720 "HTTP 204/205 responses should not cause STATE_TRANSFERRING events to be synthesized" r=biesi sr=bz
This commit is contained in:
parent
4280841edf
commit
548e42a51f
@ -241,11 +241,12 @@ NS_IMETHODIMP nsDocumentOpenInfo::OnStartRequest(nsIRequest *request, nsISupport
|
||||
|
||||
//
|
||||
// Deal with "special" HTTP responses:
|
||||
//
|
||||
// - In the case of a 204 (No Content) or 205 (Reset Content) response, do not try to find a
|
||||
// content handler. Just return. This causes the request to be
|
||||
// ignored.
|
||||
//
|
||||
//
|
||||
// - In the case of a 204 (No Content) or 205 (Reset Content) response, do
|
||||
// not try to find a content handler. Return NS_BINDING_ABORTED to cancel
|
||||
// the request. This has the effect of ensuring that the DocLoader does
|
||||
// not try to interpret this as a real request.
|
||||
//
|
||||
nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(request, &rv));
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
@ -263,7 +264,7 @@ NS_IMETHODIMP nsDocumentOpenInfo::OnStartRequest(nsIRequest *request, nsISupport
|
||||
LOG((" HTTP response status: %d", responseCode));
|
||||
|
||||
if (204 == responseCode || 205 == responseCode) {
|
||||
return NS_OK;
|
||||
return NS_BINDING_ABORTED;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user