Fixed bug 37347. HTTP HEAD requests should work now.

git-svn-id: svn://10.0.0.236/trunk@68946 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
gagan%netscape.com
2000-05-10 00:48:28 +00:00
parent 645813c95e
commit 71361e9a0b

View File

@@ -1336,7 +1336,8 @@ nsHTTPChannel::Open(PRBool bIgnoreCache)
getter_Copies(authStr))))
{
if (authStr && *authStr)
rv = mRequest->SetHeader(nsHTTPAtoms::Authorization, authStr);
rv = mRequest->SetHeader(nsHTTPAtoms::Authorization,
authStr);
}
if (mProxy && *mProxy)
@@ -1344,10 +1345,11 @@ nsHTTPChannel::Open(PRBool bIgnoreCache)
nsXPIDLCString proxyAuthStr;
if (NS_SUCCEEDED(pAuthEngine->GetProxyAuthString(mProxy,
mProxyPort,
getter_Copies(proxyAuthStr))))
getter_Copies(proxyAuthStr))))
{
if (proxyAuthStr && *proxyAuthStr)
rv = mRequest->SetHeader(nsHTTPAtoms::Proxy_Authorization,
rv = mRequest->SetHeader(
nsHTTPAtoms::Proxy_Authorization,
proxyAuthStr);
}
}
@@ -1859,6 +1861,11 @@ nsHTTPChannel::FinishedResponseHeaders(void)
OnHeadersAvailable();
mFiredOnHeadersAvailable = PR_TRUE;
// if its a head request dont call processStatusCode but wrap up instead
nsCOMPtr<nsIAtom> method = mRequest->GetMethod();
if (method.get() == nsHTTPAtoms::Head)
return ResponseCompleted(mResponseDataListener, NS_OK, nsnull);
//
// Check the status code to see if any special processing is necessary.
//