Bug 643352 keep-alive header syntax invalid r=bz

don't send the keep-alive request header. It is redundant to
connection: keep-alive and we don't send the right syntax anyhow.
This commit is contained in:
Patrick McManus 2011-03-23 11:02:33 -04:00
parent 4bd3cac746
commit 157bd1d75c

View File

@ -394,15 +394,14 @@ nsHttpHandler::AddStandardRequestHeaders(nsHttpHeaderArray *request,
//
// However, we need to send something so that we can use keepalive
// with HTTP/1.0 servers/proxies. We use "Proxy-Connection:" when
// we're talking to an http proxy, and "Connection:" otherwise
// we're talking to an http proxy, and "Connection:" otherwise.
// We no longer send the Keep-Alive request header.
NS_NAMED_LITERAL_CSTRING(close, "close");
NS_NAMED_LITERAL_CSTRING(keepAlive, "keep-alive");
const nsACString *connectionType = &close;
if (caps & NS_HTTP_ALLOW_KEEPALIVE) {
rv = request->SetHeader(nsHttp::Keep_Alive, nsPrintfCString("%u", mIdleTimeout));
if (NS_FAILED(rv)) return rv;
connectionType = &keepAlive;
} else if (useProxy) {
// Bug 92006