From: Amos Jeffries Date: Fri, 28 Nov 2008 12:08:43 +0000 (+1300) Subject: Author: Henrik Nordstrom X-Git-Tag: SQUID_3_0_STABLE11_RC1~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab06ca30b9c9a056cac3088c728c2fe3c4b79e15;p=thirdparty%2Fsquid.git Author: Henrik Nordstrom 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 af8d44d375..f11e7715e8 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1563,8 +1563,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 */