Skip to content

Commit

Permalink
Fix(workaround really) the bogus addition of user-agent: by go client…
Browse files Browse the repository at this point in the history
… lib when none is set in a proxy context
  • Loading branch information
ldemailly committed Nov 6, 2022
1 parent a9c6287 commit b3c49bf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rp/reverse_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ func GetRoutes() []config.Route {
func setDestination(req *http.Request, url *url.URL) {
req.URL.Scheme = url.Scheme
req.URL.Host = url.Host
// Horrible hack to workaround golang behavior with User-Agent: addition
// same "fix" as https://github.com/golang/go/commit/6a6c1d9841a1957a2fd292df776ea920ae38ea00
if _, ok := req.Header["User-Agent"]; !ok {
// explicitly disable User-Agent so it's not set to default value
req.Header.Set("User-Agent", "")
}
}

// Director is the object used by the ReverseProxy to pick the route/destination.
Expand Down

0 comments on commit b3c49bf

Please sign in to comment.