From 4f669bdd66c2670c6f40155d0e113ff87b1b78a3 Mon Sep 17 00:00:00 2001 From: Dmitry Sharshakov Date: Wed, 18 Dec 2019 13:22:06 +0300 Subject: [PATCH] Don't set user-agent to Go-http-client/1.1 --- pkg/server/service/proxy.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/server/service/proxy.go b/pkg/server/service/proxy.go index 6da65d090..d6fdfcb8e 100644 --- a/pkg/server/service/proxy.go +++ b/pkg/server/service/proxy.go @@ -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