From abd312f3d064ee12806214582a43f45b15682bdd Mon Sep 17 00:00:00 2001 From: Phuc-Thanh Nguyen <83806633+npt-1707@users.noreply.github.com> Date: Fri, 23 May 2025 05:43:20 +0800 Subject: [PATCH] [wpinet] http_parser: unset F_CHUNKED on new Transfer-Encoding (#7985) --- wpinet/src/main/native/cpp/http_parser.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wpinet/src/main/native/cpp/http_parser.cpp b/wpinet/src/main/native/cpp/http_parser.cpp index fcc838e15b..1fa1589814 100644 --- a/wpinet/src/main/native/cpp/http_parser.cpp +++ b/wpinet/src/main/native/cpp/http_parser.cpp @@ -1326,6 +1326,12 @@ reexecute: parser->header_state = h_general; } else if (parser->index == sizeof(TRANSFER_ENCODING)-2) { parser->header_state = h_transfer_encoding; + /* Multiple `Transfer-Encoding` headers should be treated as + * one, but with values separate by a comma. + * + * See: https://tools.ietf.org/html/rfc7230#section-3.2.2 + */ + parser->flags &= ~F_CHUNKED; } break;