From f40a09ea6f748a166f5977f92d24574438bc58fa Mon Sep 17 00:00:00 2001 From: Konstantin Astafurov Date: Thu, 25 Jan 2024 22:08:15 -0500 Subject: [PATCH] Bump to go 1.21 Change to reverseproxy.go to make tests pass came from @marsam on GitHub. --- go.mod | 2 +- reverseproxy/reverseproxy.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index ebf9da3..f4061c8 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/suyashkumar/ssl-proxy -go 1.18 +go 1.21 require ( github.com/stretchr/testify v1.7.0 diff --git a/reverseproxy/reverseproxy.go b/reverseproxy/reverseproxy.go index fcd0fc8..5ce954c 100644 --- a/reverseproxy/reverseproxy.go +++ b/reverseproxy/reverseproxy.go @@ -32,7 +32,7 @@ func newDirector(target *url.URL, extraDirector func(*http.Request)) func(*http. } else { req.URL.RawQuery = targetQuery + "&" + req.URL.RawQuery } - if _, ok := req.Header["User-Agent"]; !ok { + if req.Header.Get("User-Agent") != "" { // explicitly disable User-Agent so it's not set to default value req.Header.Set("User-Agent", "") }