diff options
author | Russ Cox <rsc@golang.org> | 2015-12-17 00:37:09 -0500 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2015-12-17 20:28:14 +0000 |
commit | 2f08bd96a0f291450c0f8cd41741fa475309cfc4 (patch) | |
tree | caba2de3afc1f153280e6b0050eb58b8e39e44e3 | |
parent | a227351b622856f1fbc76d77cd646644a975f3e7 (diff) | |
download | go-2f08bd96a0f291450c0f8cd41741fa475309cfc4.tar.gz go-2f08bd96a0f291450c0f8cd41741fa475309cfc4.zip |
cmd/go: for go get -insecure, do not fall back to HTTP for non-200 responses
Since we allow non-200 responses from HTTPS in normal operation,
it seems odd to reject them in -insecure operation.
Fixes #13037 (again).
Change-Id: Ie232f7544ab192addfad407525888db6b967befe
Reviewed-on: https://go-review.googlesource.com/17945
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-rw-r--r-- | src/cmd/go/http.go | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/cmd/go/http.go b/src/cmd/go/http.go index d558dcd0b9..13d5c46706 100644 --- a/src/cmd/go/http.go +++ b/src/cmd/go/http.go @@ -83,14 +83,11 @@ func httpsOrHTTP(importPath string, security securityMode) (urlStr string, body } } urlStr, res, err := fetch("https") - if err != nil || res.StatusCode != 200 { - if buildV && err != nil { + if err != nil { + if buildV { log.Printf("https fetch failed: %v", err) } if security == insecure { - if buildV && res.StatusCode != 200 { - log.Printf("https fetch: status %s", res.Status) - } closeBody(res) urlStr, res, err = fetch("http") } |