Skip to content

Commit

Permalink
override Host header
Browse files Browse the repository at this point in the history
  • Loading branch information
preved911 committed Jun 3, 2023
1 parent 476b479 commit e6ccdc4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/stupid-http-proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit e6ccdc4

Please sign in to comment.