Skip to content

Commit 08657ed

Browse files
committed
Make logic in security check more robust, make tests more realistic.
1 parent c17a1a7 commit 08657ed

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/cmd/go/internal/get/get.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ func downloadPackage(p *load.Package) error {
475475
}
476476
vcs, repo, rootPath = rr.vcs, rr.Repo, rr.Root
477477
}
478-
if !blindRepo && !vcs.isSecure(repo) && security == web.SecureOnly {
478+
if !blindRepo && !vcs.isSecure(repo) && security != web.Insecure {
479479
return fmt.Errorf("cannot download, %v uses insecure protocol", repo)
480480
}
481481

src/cmd/go/testdata/script/get_insecure_env.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ env GOINSECURE=
2020
! go get -d -u -f insecure.go-get-issue-15410.appspot.com/pkg/p
2121

2222
# GOPATH: Try updating with GOINSECURE glob (should succeed).
23-
env GOINSECURE=insecure.go-get-*
23+
env GOINSECURE=*.go-get-*.appspot.com
2424
go get -d -u -f insecure.go-get-issue-15410.appspot.com/pkg/p
2525

2626
# GOPATH: Try updating with GOINSECURE base URL (should succeed).

0 commit comments

Comments
 (0)