]> 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)
committerSquid Anubis <squid-anubis@squid-cache.org>
Tue, 15 Sep 2020 04:21:46 +0000 (04:21 +0000)
... 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 786a8dc1440352541ded084521606f674579b227..3d2cb8d1c07c7325c920c8ccab683f37a5f82f34 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.