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
proposal: cmd/go: use RFC 5785 .well-known URI instead of ?go-get=1 #27989
Comments
While I like people using RFC 5785, it's not exactly appropriate here. We're asking about a per-URL property on paths, not a site-wide property. If we wanted to do the appropriate thing would've used content negotiation (e.g. sending an Accept header and looking at the response Content-Type), but that was deemed too magic and hard to debug by hand, IIRC. One could say that instead of /pkg/foo/bar?go-get=1 we request /.well-known/go-get-meta/pkg/foo/bar, that could work, but it's still weird and Accept still seems like the better option. |
With the |
Using accept/content-type require dynamic request handling, which require PHP/python/ruby/CGI/whatever server side or complex httpd config too. Using a solution requiring only static content on a subfolder would be easier to set up and deployable everywhere without prerequisite or specific golang patch. |
Not only. Currently, you require no real content (or patchable one), or httpd config access to be able to configure response to |
I also don't see how we could roll out this change even if we wanted to. We'd have to make two HTTP requests for compatibility, which seems gross, even if they're done concurrently. |
Trying |
?go-get=1
If you don't want to look for go-get=1, don't. Just serve the relevant HTML meta tag always. That's what most redirectors do. Note also that the meta tag only needs to mention the root, not the page that was requested, so it's possible to serve as static content for a whole tree of packages. Note also that the go command will even look for meta tags in 404 pages, so that you don't even have to have "200 OK" content there. The current setup is working quite well and we can't possibly remove it. At most we'd have to add a second mechanism. It is not worth the disruption and confusion of introducing a second mechanism, especially one that doesn't work as well (requires control over the root of the web server space).
|
Perhaps most of redirectors don't host a Wordpress, Drupal, Prestashop or a Hugo blog on their landing page ? Or had already patch their landing software to explicitly support Go, like Gitlab did. If you use a well known software, with a team to address such software customization, or are a big company like Github, yes, you can afford |
Currently, golang use
https://example.org/pkg/module?go-get=1
to detect a custom import path.It's impossible or complicated to support such requests if the targeted domain already serve real content.
You have to patch your root site to support go-imports, which can be tedious (Wordpress) if impossible (static landing page) or to modify your httpd config with ugly tricks (like this) and add overhead on each request.
Why not use RFC5785
/.well-known/
URIs to declare a custom go-imports path instead?This way, it doesn't break existing content nor require httpd config and can be statically served.
The text was updated successfully, but these errors were encountered: