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

     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  
     6  env GO111MODULE=on
     7  env GOPROXY=direct
     8  env GOSUMDB=off
     9  
    10  ! go mod download vcs-test.golang.org/insecure/go/insecure@latest
    11  stderr 'redirected .* to insecure URL'
    12  
    13  # insecure host
    14  env GOINSECURE=vcs-test.golang.org
    15  go clean -modcache
    16  go mod download vcs-test.golang.org/insecure/go/insecure@latest
    17  
    18  # insecure glob host
    19  env GOINSECURE=*.golang.org
    20  go clean -modcache
    21  go mod download vcs-test.golang.org/insecure/go/insecure@latest
    22  
    23  # insecure multiple host
    24  env GOINSECURE=somewhere-else.com,*.golang.org
    25  go clean -modcache
    26  go mod download vcs-test.golang.org/insecure/go/insecure@latest
    27  
    28  # different insecure host does not fetch
    29  env GOINSECURE=somewhere-else.com
    30  go clean -modcache
    31  ! go mod download vcs-test.golang.org/insecure/go/insecure@latest
    32  stderr 'redirected .* to insecure URL'
    33  

View as plain text