From 4be0aa0c7a153ba05a55b077ddae7d96088bbcc2 Mon Sep 17 00:00:00 2001 From: mkishi Date: Wed, 17 Aug 2016 17:48:29 +1200 Subject: [PATCH] Bug 3025: Proxy-Authenticate problem using ICAP server --- src/client_side_reply.cc | 10 ++++++++-- src/client_side_request.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index cc8bf80ee4..c9f9e123b5 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -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(); diff --git a/src/client_side_request.h b/src/client_side_request.h index 442d36215e..e3869056d9 100644 --- a/src/client_side_request.h +++ b/src/client_side_request.h @@ -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); -- 2.47.2