Do not allow trailers to end with bare LF

This commit is contained in:
Demi Marie Obenour 2025-06-10 15:16:58 -04:00
parent 7032a60fa0
commit 9950dfbc94

View File

@ -2458,13 +2458,10 @@ before_semi:
goto invalid;
case sw_trailer:
switch (ch) {
case CR:
if (ch == CR) {
state = sw_trailer_almost_done;
break;
case LF:
goto done;
default:
}
if (ngx_http_token_char(ch)) {
state = sw_trailer_name;
r->lowcase_index = 1;
@ -2472,8 +2469,6 @@ before_semi:
break;
}
goto invalid;
}
break;
case sw_trailer_almost_done:
if (ch == LF) {
@ -2518,8 +2513,7 @@ before_semi:
state = sw_trailer_header_almost_done;
break;
}
/* fall through */
goto invalid;
case sw_trailer_header_almost_done:
if (ch == LF) {