mirror of
https://github.com/nginx/nginx.git
synced 2024-11-27 23:49:00 +08:00
Added safety belt for the case of sending header twice.
The aforementioned situation is abnormal per se and as such it now forces request termination with appropriate error message.
This commit is contained in:
parent
2b2def7891
commit
0fea0bf3f7
@ -1933,6 +1933,12 @@ ngx_http_send_response(ngx_http_request_t *r, ngx_uint_t status,
|
||||
ngx_int_t
|
||||
ngx_http_send_header(ngx_http_request_t *r)
|
||||
{
|
||||
if (r->header_sent) {
|
||||
ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
|
||||
"header already sent");
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
if (r->err_status) {
|
||||
r->headers_out.status = r->err_status;
|
||||
r->headers_out.status_line.len = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user