Skip to content

Commit

Permalink
cmd/go/internal/modfetch: avoid path.Join in URL errors, part 2
Browse files Browse the repository at this point in the history
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 <[email protected]>
Auto-Submit: Dmitri Shuralyov <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
  • Loading branch information
dmitshur authored and gopherbot committed Nov 2, 2023
1 parent 4e95093 commit 2ffe600
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cmd/go/internal/modfetch/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2ffe600

Please sign in to comment.