[PATCH] url: add distribution and version to user-agent request header (BC)

Gregory Szorc gregory.szorc at gmail.com
Thu Jul 14 01:47:54 EDT 2016


On Wed, Jul 13, 2016 at 10:38 PM, Mike Hommey <mh at glandium.org> wrote:

> On Wed, Jul 13, 2016 at 10:18:26PM -0700, Gregory Szorc wrote:
> > # HG changeset patch
> > # User Gregory Szorc <gregory.szorc at gmail.com>
> > # Date 1468473406 25200
> > #      Wed Jul 13 22:16:46 2016 -0700
> > # Node ID 6ad61d5001b1fbfebf317d0557f158d4b34a0772
> > # Parent  52433f89f816e21ca992ac8c4a41cba0345f1b73
> > url: add distribution and version to user-agent request header (BC)
> >
> > As a server operator, I've always wanted to know what Mercurial
> > version clients are running. Unfortunately, there is no easy
> > way to discern this today: the best you can do is sniff capabilities
> > from getbundle commands and those aren't updated frequently enough
> > to tell you anything that interesting.
> >
> > This patch adds the distribution name and version to the user-agent
> > HTTP request header. We choose "Mercurial" for the distribution
> > name because that seems appropriate. The version string comes
> > from __version__. It should have no spaces and should therefore be
> > safe to include outside of quotes, parenthesis, etc.
> >
> > Flagging the patch as BC so it shows up in release notes. This
> > change should be backwards compatible. But I'm sure there is a server
> > operator somewhere filtering on the existing user-agent request
> > header. So I want to make noise about this change.
>
> Did you check it doesn't break on e.g. bitbucket? They do user-agent
> sniffing, but I don't know what exactly they are sniffing for (I just
> know that if you do mercurial protocol requests with a git UA, it
> rejects you)
>

bitbucket works with this new user agent. It also works with the user agent
"foo."

bitbucket also accepts "git" but not "git/" (it 404s). So they appear to be
filtering on "git/"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20160713/f8bd32dd/attachment.html>


More information about the Mercurial-devel mailing list