]> 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>
Fri, 9 Oct 2020 02:08:11 +0000 (15:08 +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 c2d41bb12c4d170816ea7a718ce1b931a2376220..07db9171869ad512a42b520826edbe560318f1cf 100644 (file)
@@ -551,9 +551,9 @@ HttpHeader::parse(const char *header_start, size_t hdrLen, Http::ContentLengthIn
         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.