mirror of
https://github.com/nginx/nginx.git
synced 2026-07-10 19:04:51 +00:00
do not add "Connection: keep=alive" when possible
for HTTP/1.0 this header is required, for HTTP/1.1 not
This commit is contained in:
parent
6a67f71a4a
commit
b7387ea76f
1 changed files with 6 additions and 2 deletions
|
|
@ -387,7 +387,9 @@ ngx_http_header_filter(ngx_http_request_t *r)
|
|||
len += sizeof("Connection: upgrade" CRLF) - 1;
|
||||
|
||||
} else if (r->keepalive) {
|
||||
len += sizeof("Connection: keep-alive" CRLF) - 1;
|
||||
if ((r->http_version == NGX_HTTP_VERSION_10) || (clcf->keepalive_header)) {
|
||||
len += sizeof("Connection: keep-alive" CRLF) - 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* MSIE and Opera ignore the "Keep-Alive: timeout=<N>" header.
|
||||
|
|
@ -564,8 +566,10 @@ ngx_http_header_filter(ngx_http_request_t *r)
|
|||
sizeof("Connection: upgrade" CRLF) - 1);
|
||||
|
||||
} else if (r->keepalive) {
|
||||
b->last = ngx_cpymem(b->last, "Connection: keep-alive" CRLF,
|
||||
if ((r->http_version == NGX_HTTP_VERSION_10) || (clcf->keepalive_header)) {
|
||||
b->last = ngx_cpymem(b->last, "Connection: keep-alive" CRLF,
|
||||
sizeof("Connection: keep-alive" CRLF) - 1);
|
||||
}
|
||||
|
||||
if (clcf->keepalive_header) {
|
||||
b->last = ngx_sprintf(b->last, "Keep-Alive: timeout=%T" CRLF,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue