Skip to content

Commit

Permalink
Ignore whitespace chars after chunk-size
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
uhliarik committed Oct 10, 2024
1 parent 0e4873f commit 8d0ee42
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/http/one/TeChunkedParser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 8d0ee42

Please sign in to comment.