]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3025: Proxy-Authenticate problem using ICAP server
authormkishi <mkishi@104.net>
Wed, 17 Aug 2016 05:48:29 +0000 (17:48 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 17 Aug 2016 05:48:29 +0000 (17:48 +1200)
src/client_side_reply.cc
src/client_side_request.h

index cc8bf80ee4b3328047cf4531461fa6e0dc3fdac0..c9f9e123b53735b9e16a0eb981a33023003db519 100644 (file)
@@ -1305,8 +1305,14 @@ clientReplyContext::buildReplyHeader()
 
     // if there is not configured a peer proxy with login=PASS or login=PASSTHRU option enabled
     // remove the Proxy-Authenticate header
-    if ( !request->peer_login || (strcmp(request->peer_login,"PASS") != 0 && strcmp(request->peer_login,"PASSTHRU") != 0))
-        reply->header.delById(HDR_PROXY_AUTHENTICATE);
+    if ( !request->peer_login || (strcmp(request->peer_login,"PASS") != 0 && strcmp(request->peer_login,"PASSTHRU") != 0)) {
+#if USE_ADAPTATION
+        // but allow adaptation services to authenticate clients
+        // via request satisfaction
+        if (!http->requestSatisfactionMode())
+#endif
+            reply->header.delById(HDR_PROXY_AUTHENTICATE);
+    }
 
     reply->header.removeHopByHopEntries();
 
index 442d36215eaea0f53cb76aed2bc489e17fa873e7..e3869056d9b8e5562be5cb31383323aa28c9af39 100644 (file)
@@ -140,6 +140,7 @@ public:
 
 public:
     void startAdaptation(const Adaptation::ServiceGroupPointer &g);
+    bool requestSatisfactionMode() const { return request_satisfaction_mode; }
 
     // private but exposed for ClientRequestContext
     void handleAdaptationFailure(int errDetail, bool bypassable = false);