From 562be3a62c246413a0a24cad4d71a79128e46814 Mon Sep 17 00:00:00 2001 From: npt-1707 Date: Fri, 23 May 2025 02:30:15 +0800 Subject: [PATCH] proxygen/external/http_parser/http_parser.c: unset F_CHUNKED on new Transfer-Encoding --- proxygen/external/http_parser/http_parser_cpp.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/proxygen/external/http_parser/http_parser_cpp.cpp b/proxygen/external/http_parser/http_parser_cpp.cpp index b645395b92..e29afa9c5b 100644 --- a/proxygen/external/http_parser/http_parser_cpp.cpp +++ b/proxygen/external/http_parser/http_parser_cpp.cpp @@ -1579,6 +1579,12 @@ size_t http_parser_execute_options (http_parser *parser, 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;