]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix ICAP Allow header containing only trailers option
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 18 Nov 2016 06:19:19 +0000 (19:19 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 18 Nov 2016 06:19:19 +0000 (19:19 +1300)
r14941 added 'tailers' option to te Allow header but did not send it when
only that option was used, without the 204 or 206 features.

 Detected by Coverity Scan. Issue 1394381.

src/adaptation/icap/ModXact.cc

index 549a78ec45f618acbf08577a55da45dbfc9b0b5e..4efac62e988d50a23bd7e226d0f470c30bea583f 100644 (file)
@@ -1528,13 +1528,13 @@ void Adaptation::Icap::ModXact::makeAllowHeader(MemBuf &buf)
     const bool allow206out = state.allowedPostview206 = shouldAllow206out();
     const bool allowTrailers = true; // TODO: make configurable
 
-    debugs(93,9, HERE << "Allows: " << allow204in << allow204out <<
+    debugs(93, 9, "Allows: " << allow204in << allow204out <<
            allow206in << allow206out << allowTrailers);
 
     const bool allow204 = allow204in || allow204out;
     const bool allow206 = allow206in || allow206out;
 
-    if (!allow204 && !allow206)
+    if (!allow204 && !allow206 && !allowTrailers)
         return; // nothing to do
 
     if (virginBody.expected()) // if there is a virgin body, plan to send it