set X-Forwarded-Host to orid host, drop X-Origin-Host #67

This commit is contained in:
Umputun 2021-05-10 03:50:00 -05:00
parent a73a16c12b
commit 25ee73d8d6

View File

@ -171,8 +171,7 @@ func (h *Http) proxyHandler() http.HandlerFunc {
Director: func(r *http.Request) { Director: func(r *http.Request) {
ctx := r.Context() ctx := r.Context()
uu := ctx.Value(contextKey("url")).(*url.URL) uu := ctx.Value(contextKey("url")).(*url.URL)
r.Header.Add("X-Forwarded-Host", uu.Host) r.Header.Add("X-Forwarded-Host", r.Host)
r.Header.Set("X-Origin-Host", r.Host)
r.URL.Path = uu.Path r.URL.Path = uu.Path
r.URL.Host = uu.Host r.URL.Host = uu.Host
r.URL.Scheme = uu.Scheme r.URL.Scheme = uu.Scheme