Don't set user-agent to Go-http-client/1.1

This commit is contained in:
Dmitry Sharshakov 2019-12-18 13:22:06 +03:00 committed by Traefiker Bot
parent 8930236396
commit 4f669bdd66

View file

@ -52,6 +52,10 @@ func buildProxy(passHostHeader *bool, responseForwarding *dynamic.ResponseForwar
outReq.ProtoMajor = 1
outReq.ProtoMinor = 1
if _, ok := outReq.Header["User-Agent"]; !ok {
outReq.Header.Set("User-Agent", "")
}
// Do not pass client Host header unless optsetter PassHostHeader is set.
if passHostHeader != nil && !*passHostHeader {
outReq.Host = outReq.URL.Host