]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Accept ICAP OPTIONS responses with unknown body types.
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 4 Oct 2010 14:37:32 +0000 (08:37 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Mon, 4 Oct 2010 14:37:32 +0000 (08:37 -0600)
Warn about the unknown OPTIONS body type but ignore it instead of rejecting
the entire OPTIONS response. Note that ICAP does not standardize OPTIONS
body types, and Squid does not recognize any body type.

ICAP servers are supposed to negotiate the use of OPTIONS bodies but
negotiation mechanism is not standardized and some do not negotiate at all.

src/adaptation/icap/Options.cc

index 4cf37cb337efaf1ba18116631cf1572c4ce1bb05..05fcfa312e4430fc6a712baedf24a566b70d6c83 100644 (file)
@@ -90,8 +90,12 @@ void Adaptation::Icap::Options::configure(const HttpReply *reply)
 
     istag = h->getByName("ISTag");
 
-    if (h->getByName("Opt-body-type").size())
-        error = "ICAP service returns unsupported OPTIONS body";
+    if (h->getByName("Opt-body-type").size()) {
+        // TODO: add a class to rate-limit such warnings using FadingCounter
+        debugs(93,DBG_IMPORTANT, "WARNING: Ignoring unsupported ICAP " <<
+            "OPTIONS body; type: " << h->getByName("Opt-body-type"));
+        // Do not set error, assuming the response headers are valid.
+    }
 
     cfgIntHeader(h, "Max-Connections", max_connections);