r=sdagley. 20669. we were sending a cookie header for *every* url request; empty for urls that didn't have a cookie associated with them. Now we only set cookies when we have one to set

This commit is contained in:
valeski%netscape.com 1999-12-03 07:01:23 +00:00
parent b058c98ccd
commit 940d90a9cd

View File

@ -121,7 +121,10 @@ nsCookieHTTPNotify::ModifyRequest(nsISupports *aContext)
// XXX useless convertion from nsString to char * again
const char *cookieRaw = cookie.ToNewCString();
if (!cookieRaw) return NS_ERROR_OUT_OF_MEMORY;
rv = pHTTPConnection->SetRequestHeader(mCookieHeader, cookieRaw);
// only set a cookie header if we have a value to send
if (*cookieRaw)
rv = pHTTPConnection->SetRequestHeader(mCookieHeader, cookieRaw);
nsAllocator::Free((void *)cookieRaw);
return rv;