mirror of
https://github.com/nginx/nginx.git
synced 2024-12-13 02:39:00 +08:00
Fixed response line formatting with empty reason phrase.
As per RFC 2616 sec 6.1 the response status code is always followed by SP.
This commit is contained in:
parent
63b1baa7f1
commit
bff2b8d69f
@ -264,13 +264,13 @@ ngx_http_header_filter(ngx_http_request_t *r)
|
|||||||
len += ngx_http_status_lines[status].len;
|
len += ngx_http_status_lines[status].len;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
len += NGX_INT_T_LEN;
|
len += NGX_INT_T_LEN + 1 /* SP */;
|
||||||
status_line = NULL;
|
status_line = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status_line && status_line->len == 0) {
|
if (status_line && status_line->len == 0) {
|
||||||
status = r->headers_out.status;
|
status = r->headers_out.status;
|
||||||
len += NGX_INT_T_LEN;
|
len += NGX_INT_T_LEN + 1 /* SP */;
|
||||||
status_line = NULL;
|
status_line = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -451,7 +451,7 @@ ngx_http_header_filter(ngx_http_request_t *r)
|
|||||||
b->last = ngx_copy(b->last, status_line->data, status_line->len);
|
b->last = ngx_copy(b->last, status_line->data, status_line->len);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
b->last = ngx_sprintf(b->last, "%03ui", status);
|
b->last = ngx_sprintf(b->last, "%03ui ", status);
|
||||||
}
|
}
|
||||||
*b->last++ = CR; *b->last++ = LF;
|
*b->last++ = CR; *b->last++ = LF;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user