From e6ccdc48400f386dd2c3d0c71b4d52749f11e833 Mon Sep 17 00:00:00 2001 From: Ildar Valiullin Date: Sun, 4 Jun 2023 01:39:51 +0300 Subject: [PATCH] override Host header --- cmd/stupid-http-proxy/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/stupid-http-proxy/main.go b/cmd/stupid-http-proxy/main.go index 55d32b2..8cb1531 100644 --- a/cmd/stupid-http-proxy/main.go +++ b/cmd/stupid-http-proxy/main.go @@ -29,7 +29,7 @@ func main() { proxy := &httputil.ReverseProxy{ Rewrite: func(r *httputil.ProxyRequest) { r.SetURL(target) - r.Out.Host = r.In.Host + r.Out.Host = target.Host }, } http.ListenAndServe(":8080", logRequestMiddleware(proxy))