From 331dc0c938cb89355e49ed42c14b823bf8a2fadb Mon Sep 17 00:00:00 2001 From: David Bartley Date: Fri, 6 Mar 2020 14:38:19 -0800 Subject: [PATCH] Fix things caught by `go vet`. --- https.go | 4 ++-- proxy_test.go | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/https.go b/https.go index 28772919..983e5dc8 100644 --- a/https.go +++ b/https.go @@ -425,7 +425,7 @@ func TLSConfigFromCA(ca *tls.Certificate) func(host string, ctx *ProxyCtx) (*tls var cert *tls.Certificate hostname := stripPort(host) - config := *defaultTLSConfig + config := defaultTLSConfig.Clone() ctx.Logf("signing for %s", stripPort(host)) genCert := func() (*tls.Certificate, error) { @@ -443,6 +443,6 @@ func TLSConfigFromCA(ca *tls.Certificate) func(host string, ctx *ProxyCtx) (*tls } config.Certificates = append(config.Certificates, *cert) - return &config, nil + return config, nil } } diff --git a/proxy_test.go b/proxy_test.go index dafe0e62..c091d67f 100644 --- a/proxy_test.go +++ b/proxy_test.go @@ -507,8 +507,7 @@ func constantHttpServer(content []byte) (addr string) { func TestIcyResponse(t *testing.T) { // TODO: fix this test - return // skip for now - s := constantHttpServer([]byte("ICY 200 OK\r\n\r\nblablabla")) + /*s := constantHttpServer([]byte("ICY 200 OK\r\n\r\nblablabla")) proxy := goproxy.NewProxyHttpServer() proxy.Verbose = true _, l := oneShotProxy(proxy, t) @@ -525,7 +524,7 @@ func TestIcyResponse(t *testing.T) { panicOnErr(err, "readAll") if string(raw) != "ICY 200 OK\r\n\r\nblablabla" { t.Error("Proxy did not send the malformed response received") - } + }*/ } type VerifyNoProxyHeaders struct {