]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/modfetch: halt proxy fallback if the proxy returns a non-404/410...
authorBryan C. Mills <bcmills@google.com>
Tue, 25 Jun 2019 21:13:21 +0000 (17:13 -0400)
committerBryan C. Mills <bcmills@google.com>
Wed, 26 Jun 2019 19:14:29 +0000 (19:14 +0000)
commit4b41f7f8188ce8f711cacd3097a2cb02af5c333c
treee994fd4340523b1ba222cd789dd9d1ee01371c33
parent070e2dda0252138ebe319a4f8839d71cbf57cd2a
cmd/go/internal/modfetch: halt proxy fallback if the proxy returns a non-404/410 response for @latest

The @latest proxy endpoint is optional. If a proxy returns a 404 for
it, and returns an @v/list with no matching versions, then we should
allow module lookup to try other module paths. However, if the proxy
returns some other error (say, a 403 or 505), then the result of the
lookup is ambiguous, and we should report the actual error rather than
"no matching versions for query".

(This fix was prompted by discussion with Dmitri on CL 183619.)

Updates #32715
Updates #26334

Change-Id: I6d510a5ac24d48d9bc5037c3c747ac50695c663f
Reviewed-on: https://go-review.googlesource.com/c/go/+/183845
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/internal/modfetch/proxy.go
src/cmd/go/testdata/script/mod_query_empty.txt