...

Text file src/cmd/go/testdata/script/mod_download_insecure_redirect.txt

Documentation: cmd/go/testdata/script

     1# golang.org/issue/29591: 'go get' was following plain-HTTP redirects even without -insecure (now replaced by GOINSECURE).
     2
     3[short] skip
     4[!git] skip
     5
     6env GO111MODULE=on
     7env GOPROXY=direct
     8env GOSUMDB=off
     9
    10! go mod download vcs-test.golang.org/insecure/go/insecure@latest
    11stderr 'redirected .* to insecure URL'
    12
    13# insecure host
    14env GOINSECURE=vcs-test.golang.org
    15go clean -modcache
    16go mod download vcs-test.golang.org/insecure/go/insecure@latest
    17
    18# insecure glob host
    19env GOINSECURE=*.golang.org
    20go clean -modcache
    21go mod download vcs-test.golang.org/insecure/go/insecure@latest
    22
    23# insecure multiple host
    24env GOINSECURE=somewhere-else.com,*.golang.org
    25go clean -modcache
    26go mod download vcs-test.golang.org/insecure/go/insecure@latest
    27
    28# different insecure host does not fetch
    29env GOINSECURE=somewhere-else.com
    30go clean -modcache
    31! go mod download vcs-test.golang.org/insecure/go/insecure@latest
    32stderr 'redirected .* to insecure URL'

View as plain text