From 3a26a5b4d3b055374b2389fc719538d7087f99dc Mon Sep 17 00:00:00 2001 From: Garnet Date: Thu, 23 May 2024 12:03:00 -0700 Subject: [PATCH] Use correct Host HTTP header --- src/mod/dynamicproxy/dpcore/dpcore.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/mod/dynamicproxy/dpcore/dpcore.go b/src/mod/dynamicproxy/dpcore/dpcore.go index e7b360b..ecf6294 100644 --- a/src/mod/dynamicproxy/dpcore/dpcore.go +++ b/src/mod/dynamicproxy/dpcore/dpcore.go @@ -346,11 +346,8 @@ func (p *ReverseProxy) ProxyHTTP(rw http.ResponseWriter, req *http.Request, rrr p.Director(outreq) outreq.Close = false - if !rrr.UseTLS { - //This seems to be routing to external sites - //Do not keep the original host - outreq.Host = rrr.OriginalHost - } + // Always use the original host, see issue #164 + outreq.Host = rrr.OriginalHost // We may modify the header (shallow copied above), so we only copy it. outreq.Header = make(http.Header)