diff options
| author | Ryan Leung <rleungx@gmail.com> | 2021-11-23 03:00:32 +0000 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2022-05-08 17:27:54 +0000 |
| commit | dd8d425fedd88970a7ee79e908eb47f6d1fcdcad (patch) | |
| tree | 053018dbeb61dff1c4b8911cd59f15dea6d7f883 /src/net/http | |
| parent | df57592276bc26e2eb4e4ca5e77e4e2e422c7c6b (diff) | |
| download | go-dd8d425fedd88970a7ee79e908eb47f6d1fcdcad.tar.xz | |
all: fix some lint issues
Make some code more simple.
Change-Id: I801adf0dba5f6c515681345c732dbb907f945419
GitHub-Last-Rev: a505146baca00a1b3268d11d10510afa8cea6f1d
GitHub-Pull-Request: golang/go#49626
Reviewed-on: https://go-review.googlesource.com/c/go/+/364634
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/net/http')
| -rw-r--r-- | src/net/http/cookiejar/jar.go | 6 | ||||
| -rw-r--r-- | src/net/http/httputil/reverseproxy.go | 1 |
2 files changed, 2 insertions, 5 deletions
diff --git a/src/net/http/cookiejar/jar.go b/src/net/http/cookiejar/jar.go index 309dfcc0e1..c2393a0741 100644 --- a/src/net/http/cookiejar/jar.go +++ b/src/net/http/cookiejar/jar.go @@ -303,10 +303,8 @@ func canonicalHost(host string) (string, error) { return "", err } } - if strings.HasSuffix(host, ".") { - // Strip trailing dot from fully qualified domain names. - host = host[:len(host)-1] - } + // Strip trailing dot from fully qualified domain names. + host = strings.TrimSuffix(host, ".") encoded, err := toASCII(host) if err != nil { return "", err diff --git a/src/net/http/httputil/reverseproxy.go b/src/net/http/httputil/reverseproxy.go index b7244134f0..082490faaa 100644 --- a/src/net/http/httputil/reverseproxy.go +++ b/src/net/http/httputil/reverseproxy.go @@ -622,7 +622,6 @@ func (p *ReverseProxy) handleUpgradeResponse(rw http.ResponseWriter, req *http.R go spc.copyToBackend(errc) go spc.copyFromBackend(errc) <-errc - return } // switchProtocolCopier exists so goroutines proxying data back and |
