From 548e42a51fde2e58d3d42ec835e63c3a4481a0cd Mon Sep 17 00:00:00 2001 From: "darin%meer.net" Date: Sat, 12 Feb 2005 00:40:46 +0000 Subject: [PATCH] fixes bug 276720 "HTTP 204/205 responses should not cause STATE_TRANSFERRING events to be synthesized" r=biesi sr=bz --- uriloader/base/nsURILoader.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/uriloader/base/nsURILoader.cpp b/uriloader/base/nsURILoader.cpp index 9349467a5340..48426da47ed1 100644 --- a/uriloader/base/nsURILoader.cpp +++ b/uriloader/base/nsURILoader.cpp @@ -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 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; } }