mirror of
https://github.com/nginx/nginx.git
synced 2025-07-21 03:44:05 +08:00
Do not allow trailers to end with bare LF
This commit is contained in:
parent
7032a60fa0
commit
9950dfbc94
@ -2458,13 +2458,10 @@ before_semi:
|
|||||||
goto invalid;
|
goto invalid;
|
||||||
|
|
||||||
case sw_trailer:
|
case sw_trailer:
|
||||||
switch (ch) {
|
if (ch == CR) {
|
||||||
case CR:
|
|
||||||
state = sw_trailer_almost_done;
|
state = sw_trailer_almost_done;
|
||||||
break;
|
break;
|
||||||
case LF:
|
}
|
||||||
goto done;
|
|
||||||
default:
|
|
||||||
if (ngx_http_token_char(ch)) {
|
if (ngx_http_token_char(ch)) {
|
||||||
state = sw_trailer_name;
|
state = sw_trailer_name;
|
||||||
r->lowcase_index = 1;
|
r->lowcase_index = 1;
|
||||||
@ -2472,8 +2469,6 @@ before_semi:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
goto invalid;
|
goto invalid;
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case sw_trailer_almost_done:
|
case sw_trailer_almost_done:
|
||||||
if (ch == LF) {
|
if (ch == LF) {
|
||||||
@ -2518,8 +2513,7 @@ before_semi:
|
|||||||
state = sw_trailer_header_almost_done;
|
state = sw_trailer_header_almost_done;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
goto invalid;
|
||||||
/* fall through */
|
|
||||||
|
|
||||||
case sw_trailer_header_almost_done:
|
case sw_trailer_header_almost_done:
|
||||||
if (ch == LF) {
|
if (ch == LF) {
|
||||||
|
Loading…
Reference in New Issue
Block a user