From 2cc5d5c259ef9509bb7e7b1a7931c9e65a0ac8ca Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Sat, 23 Oct 2010 07:36:27 -0600 Subject: [PATCH] Author: Alex Rousskov Accept ICAP OPTIONS responses with unknown body types. 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 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/adaptation/icap/Options.cc b/src/adaptation/icap/Options.cc index 630dcbfbc4..b08a857d4d 100644 --- a/src/adaptation/icap/Options.cc +++ b/src/adaptation/icap/Options.cc @@ -89,8 +89,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); -- 2.47.2