Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(workaround really) the bogus addition of user-agent: #16

Merged
merged 1 commit into from
Nov 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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