]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/modfetch: show real URL in response body read errors
authorDmitri Shuralyov <dmitshur@golang.org>
Sun, 1 Oct 2023 21:17:44 +0000 (17:17 -0400)
committerGopher Robot <gobot@golang.org>
Fri, 3 Nov 2023 15:21:05 +0000 (15:21 +0000)
commit8b14e998fbd09512a1be96361e62726ca90552f7
tree8043d77bde76c28875b094ecaf512f3b02d796c9
parente2d9574b14b3db044331da0c6fadeb62315c644a
cmd/go/internal/modfetch: show real URL in response body read errors

CL 233437 added a redactedURL field to proxyRepo, a struct that already
had a field named 'url'. Neither fields were documented, so the similar
names suggest the most natural interpretation that proxyRepo.redactedURL
is equivalent to proxyRepo.url.Redacted() rather than something else.
That's possibly why it was joined with the module version in CL 406675.

It turns out the two URLs differ in more than just redaction: one is the
base proxy URL with (escaped) module path joined, the other is just the
base proxy URL, in redacted form.

Document and rename the fields to make the distinction more clear, and
include all 3 of base module proxy URL + module path + module version
in the reported URL, rather than just the first and third bits as seen
in the errors at https://go.dev/issue/51323#issuecomment-1735812250.

For #51323.
Updates #38680.
Updates #52727.

Change-Id: Ib4b134b548adeec826ee88fe51a2cf580fde0516
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/532035
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/cmd/go/internal/modfetch/proxy.go