From: Henrik Nordstrom Date: Tue, 25 Nov 2008 12:22:19 +0000 (+0100) Subject: Fix cache_peer forceddomainname when request has a Host header X-Git-Tag: SQUID_3_2_0_1~1324 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=488b27c52bc2279046ed0cd6e17da2c8f5d87fb7;p=thirdparty%2Fsquid.git Fix cache_peer forceddomainname when request has a Host header cache_peer forceddomainname=xxx only worked when the received request did not have a Host header. --- diff --git a/src/http.cc b/src/http.cc index f20c942c9e..03b3d1f59f 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1698,8 +1698,9 @@ copyOneHeaderFromClientsideRequestToUpstreamRequest(const HttpHeaderEntry *e, St * went through our redirector and the admin configured * 'redir_rewrites_host' to be off. */ - - if (request->flags.redirected && !Config.onoff.redir_rewrites_host) + if (orig_request->peer_domain) + hdr_out->putStr(HDR_HOST, orig_request->peer_domain); + else if (request->flags.redirected && !Config.onoff.redir_rewrites_host) hdr_out->addEntry(e->clone()); else { /* use port# only if not default */