Upstream: reset parsing state after invalid status line

Previously, it was possible to start parsing headers with a wrong
parsing state after status line was not recognized, as a fallback
used in the scgi and uwsgi modules.

Reported by Leo Lin.
This commit is contained in:
Sergey Kandaurov 2026-04-29 21:56:51 +04:00 committed by Sergey Kandaurov
parent 54b7945961
commit baef7fdac2
2 changed files with 2 additions and 0 deletions

View file

@ -1036,6 +1036,7 @@ ngx_http_scgi_process_status_line(ngx_http_request_t *r)
if (rc == NGX_ERROR) {
u->process_header = ngx_http_scgi_process_header;
r->state = 0;
return ngx_http_scgi_process_header(r);
}

View file

@ -1275,6 +1275,7 @@ ngx_http_uwsgi_process_status_line(ngx_http_request_t *r)
if (rc == NGX_ERROR) {
u->process_header = ngx_http_uwsgi_process_header;
r->state = 0;
return ngx_http_uwsgi_process_header(r);
}