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>
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 {