diff options
| author | Dmitri Shuralyov <dmitshur@golang.org> | 2023-10-01 16:03:01 -0400 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2023-11-02 19:15:05 +0000 |
| commit | 2ffe600dfafcae748e98c9676283c7e0e1bbc667 (patch) | |
| tree | 6d89da621e690a4cfec825ead39f69276ae149d2 /src | |
| parent | 4e9509303b30b8948d53e6c71633e73060d8031d (diff) | |
| download | go-2ffe600dfafcae748e98c9676283c7e0e1bbc667.tar.xz | |
cmd/go/internal/modfetch: avoid path.Join in URL errors, part 2
CL 406675 added more detail to bare errors from net/http in two places.
CL 461682 improved one of the two places to stop folding "//" into "/".
This CL applies the same change to the other place.
For #52727.
Change-Id: I3fc13f30cf0f054949ce78269c52b7fafd477e70
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/532015
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/go/internal/modfetch/proxy.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/go/internal/modfetch/proxy.go b/src/cmd/go/internal/modfetch/proxy.go index dd37ba98f2..56a6aaa40d 100644 --- a/src/cmd/go/internal/modfetch/proxy.go +++ b/src/cmd/go/internal/modfetch/proxy.go @@ -432,7 +432,7 @@ func (p *proxyRepo) Zip(ctx context.Context, dst io.Writer, version string) erro if _, err := io.Copy(dst, lr); err != nil { // net/http doesn't add context to Body errors, so add it here. // (See https://go.dev/issue/52727.) - err = &url.Error{Op: "read", URL: pathpkg.Join(p.redactedURL, path), Err: err} + err = &url.Error{Op: "read", URL: strings.TrimSuffix(p.redactedURL, "/") + "/" + path, Err: err} return p.versionError(version, err) } if lr.N <= 0 { |
