|
|
Descriptioncmd/go: Include version information into User-Agent HTTP header.
`go get` now sets custom User-Agent HTTP header with Go version.
It helps webmasters to distinguish 'go get' requests from other
requests made by http.DefaultClient.
Patch Set 1 #Patch Set 2 : diff -r 8c44c45a208e http://code.google.com/p/go/ #
Total comments: 2
Patch Set 3 : diff -r d58997478ec6 http://code.google.com/p/go/ #MessagesTotal messages: 15
This is the first time I use Mercurial or Rietveld. I hope I did everything okay. Should I add myself into CONTRIBUTORS and AUTHORS?
Sign in to reply to this message.
Hello golang-dev@googlegroups.com, I'd like you to review this change to http://code.google.com/p/go/
Sign in to reply to this message.
The Github UA requirement has no impact on 'go get' because 'go get' does not use the Github API.
Sign in to reply to this message.
On 2013/02/14 18:22:47, gburd wrote: > The Github UA requirement has no impact on 'go get' because 'go get' does not > use the Github API. Correct. But it's still nice for webmasters.
Sign in to reply to this message.
On 2013/02/14 18:25:50, AlekSi wrote: > On 2013/02/14 18:22:47, gburd wrote: > > The Github UA requirement has no impact on 'go get' because 'go get' does not > > use the Github API. > > Correct. But it's still nice for webmasters. Doesn't the net/http package already set the user agent to "Go http package" by default? http://code.google.com/p/go/source/browse/src/pkg/net/http/request.go#286 That's what requests from Go programs show up as in my server logs.
Sign in to reply to this message.
kisielk, the user agent setting in net/http does not distinguish 'go get' from other clients written in Go. AlekSi, update the change description to remove the reference to Github.
Sign in to reply to this message.
> Doesn't the net/http package already set the user agent to "Go http package" by > default? > http://code.google.com/p/go/source/browse/src/pkg/net/http/request.go#286 > > That's what requests from Go programs show up as in my server logs. Yes, `net/http` sets "Go http package" by default. Right now I can't tell from http://gonuts.io logs if: - someone uses `go get` instead of `nut get` to download and install nut, or - someone uses `net/http` in his/her own program without setting User-Agent, or - it's godoc.org's crawler. Last point was fixed by Gary (godoc.org's author) recently (https://github.com/garyburd/gopkgdoc/issues/60). It would be nice to distinguish first point from second. And version in User-Agent will give me (and us) some interesting statistics.
Sign in to reply to this message.
Hello golang-dev@googlegroups.com, gary.burd@gmail.com, kamil.kisiel@gmail.com (cc: golang-dev@googlegroups.com), Please take another look.
Sign in to reply to this message.
Hello golang-dev@googlegroups.com, gary.burd@gmail.com, kamil.kisiel@gmail.com (cc: golang-dev@googlegroups.com), Please take another look.
Sign in to reply to this message.
https://codereview.appspot.com/7326044/diff/15001/src/cmd/go/http.go File src/cmd/go/http.go (right): https://codereview.appspot.com/7326044/diff/15001/src/cmd/go/http.go#newcode28 src/cmd/go/http.go:28: // Custom User-Agent is always useful and sometimes required. It's not always useful. That implies there is never a case where somebody or something doesn't care. And I've personally never cared. Thus: it's not always useful. More importantly: document here why it's sometimes required. I've seen no problems so far.
Sign in to reply to this message.
https://codereview.appspot.com/7326044/diff/15001/src/cmd/go/http.go File src/cmd/go/http.go (right): https://codereview.appspot.com/7326044/diff/15001/src/cmd/go/http.go#newcode29 src/cmd/go/http.go:29: var httpUserAgent = fmt.Sprintf("Go get tool (%s)", runtime.Version()) i don't think it's necessary. i think it's important for crawlers to correctly identify themselves, but making client add this detail in UA doesn't feel right.
Sign in to reply to this message.
FWIW, I don't care either way. I was just pointing out that the comment could be more accurate and helpful. On Fri, Feb 15, 2013 at 2:36 AM, <minux.ma@gmail.com> wrote: > > https://codereview.appspot.**com/7326044/diff/15001/src/**cmd/go/http.go<http... > File src/cmd/go/http.go (right): > > https://codereview.appspot.**com/7326044/diff/15001/src/** > cmd/go/http.go#newcode29<https://codereview.appspot.com/7326044/diff/15001/src/cmd/go/http.go#newcode29> > src/cmd/go/http.go:29: var httpUserAgent = fmt.Sprintf("Go get tool > (%s)", runtime.Version()) > i don't think it's necessary. > > i think it's important for crawlers to correctly identify > themselves, but making client add this detail in UA doesn't > feel right. > > https://codereview.appspot.**com/7326044/<https://codereview.appspot.com/7326... >
Sign in to reply to this message.
Hello golang-dev@googlegroups.com, gary.burd@gmail.com, kamil.kisiel@gmail.com, bradfitz@golang.org, minux.ma@gmail.com (cc: golang-dev@googlegroups.com), Please take another look.
Sign in to reply to this message.
I still don't understand why this is necessary. Go net/http client already specifies major Go version in the default UA string. (https://codereview.appspot.com/7532043) Why separate "go get" from other Go programs?
Sign in to reply to this message.
Hi, > I still don't understand why this is necessary. > Go net/http client already specifies major Go version in the default UA string. > (https://codereview.appspot.com/7532043) First version of this CL was made before one mentioned above, and I missed it. Sorry for noise. –-– Alexey "AlekSi" Palazhchenko
Sign in to reply to this message.
|