]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Restored support for non-lowercase Transfer-Encoding values (#723)
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 15 Sep 2020 04:07:43 +0000 (04:07 +0000)
committerAmos Jeffries <yadij@users.noreply.github.com>
Mon, 23 Nov 2020 09:44:04 +0000 (22:44 +1300)
... after "Improve Transfer-Encoding handling" commit f6dd87e.

Folks are reporting Chunked Transfer-Encoding values in real
traffic. HTTP requires case-insensitve treatment of codings.

src/HttpHeader.cc

index f30802eb79ca93b555e20ac2b5bde4f96149e994..8efc1d60ab21d5913f3451a93fb58596aef13ea8 100644 (file)
@@ -480,9 +480,9 @@ HttpHeader::parse(const char *header_start, size_t hdrLen)
         delById(Http::HdrType::CONTENT_LENGTH);
         // and clen state becomes irrelevant
 
-        if (rawTe == "chunked") {
+        if (rawTe.caseCmp("chunked") == 0) {
             ; // leave header present for chunked() method
-        } else if (rawTe == "identity") { // deprecated. no coding
+        } else if (rawTe.caseCmp("identity") == 0) { // deprecated. no coding
             delById(Http::HdrType::TRANSFER_ENCODING);
         } else {
             // This also rejects multiple encodings until we support them properly.