From 8d0ee420a4d91ac7fd97316338f1e28b4b060cbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Uhliarik?= Date: Thu, 10 Oct 2024 19:26:27 +0200 Subject: [PATCH] Ignore whitespace chars after chunk-size Previously (before #1498 change), squid was accepting TE-chunked replies with whitespaces after chunk-size and missing chunk-ext data. After It turned out that replies with such whitespace chars are pretty common and other webservers which can act as forward proxies (e.g. nginx, httpd...) are accepting them. This change will allow to proxy chunked responses from origin server, which had whitespaces inbetween chunk-size and CRLF. --- src/http/one/TeChunkedParser.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/http/one/TeChunkedParser.cc b/src/http/one/TeChunkedParser.cc index 9cce10fdc91..04753395e16 100644 --- a/src/http/one/TeChunkedParser.cc +++ b/src/http/one/TeChunkedParser.cc @@ -125,6 +125,7 @@ Http::One::TeChunkedParser::parseChunkMetadataSuffix(Tokenizer &tok) // Code becomes much simpler when incremental parsing functions throw on // bad or insufficient input, like in the code below. TODO: Expand up. try { + tok.skipAll(CharacterSet::WSP); // Some servers send SP/TAB after chunk-size parseChunkExtensions(tok); // a possibly empty chunk-ext list tok.skipRequired("CRLF after [chunk-ext]", Http1::CrLf()); buf_ = tok.remaining();