Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: allow omitting http scheme from GOPROXY #32191

Closed
rogpeppe opened this issue May 22, 2019 · 6 comments
Closed

cmd/go: allow omitting http scheme from GOPROXY #32191

rogpeppe opened this issue May 22, 2019 · 6 comments

Comments

@rogpeppe
Copy link
Contributor

@rogpeppe rogpeppe commented May 22, 2019

Currently, GOPROXY has to be specified as a full URL (https://proxy.golang.org) whereas GOSUMDB does not (sum.golang.org). Without knowing the details of the underlying protocol, this seems like an unnecessary inconsistency that will be easy for people to get wrong.

How about allowing GOPROXY to be specified without the URL scheme? So:

GOPROXY=proxy.golang.org

would be treated the same as:

GOPROXY=https://proxy.golang.org

Then in the common case, both GOPROXY and GOSUMDB can be specified in a similar way. The go command would continue to accept a full URL for GOPROXY so all the original flexibility is still available.

@rogpeppe rogpeppe added the modules label May 22, 2019
@rogpeppe rogpeppe changed the title cmd/go: allow omitting http schema from GOPROXY cmd/go: allow omitting http scheme from GOPROXY May 22, 2019
@bradfitz bradfitz added this to the Go1.13 milestone May 23, 2019
@bradfitz

This comment has been minimized.

Copy link
Member

@bradfitz bradfitz commented May 23, 2019

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented May 28, 2019

Change https://golang.org/cl/179217 mentions this issue: cmd/go: default to HTTPS for GOPROXY URLs

@rsc

This comment has been minimized.

Copy link
Contributor

@rsc rsc commented Jun 4, 2019

I agree this inconsistency is annoying and hard to explain. Let's say that a GOPROXY entry (something in the comma-separated list) without :// gets https:// inserted at the front, and let's also say that a leading https:// in GOSUMDB is dropped before the rest of the processing happens.

@bcmills

This comment has been minimized.

Copy link
Member

@bcmills bcmills commented Jun 6, 2019

One minor wrinkle: we should probably reserve dotless words for special tokens. (Today we have off and direct, and we may want to add others.)

Those will be fine with an explicit https:// prefix.

@bcmills

This comment has been minimized.

Copy link
Member

@bcmills bcmills commented Jun 6, 2019

One more wrinkle: RFC 8089 allows file URIs of the form file:/path/to/file or file:c:/path/to/file. I suggest that we check for the :/ token rather than ://.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jun 6, 2019

Change https://golang.org/cl/181019 mentions this issue: cmd/go: allow GOPROXY to elide the "https://" prefix

@gopherbot gopherbot closed this in bdd4201 Jun 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.