Use correct Host HTTP header

This commit is contained in:
Garnet 2024-05-23 12:03:00 -07:00 committed by GitHub
parent 2cdd5654ed
commit 3a26a5b4d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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
// 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)