changeset 35733:3d48ae1aaa5e

lfs: default the User-Agent header for blob transfers to 'git-lfs' The custom User-Agent for blob transfers was added in e7bb5fc4570c. Now I've hit another incompatibility with a server wanting the string to start with 'git' or 'git-lfs' [1]. I don't feel strongly about this either way, but a Wireshark trace of git shows that when the Batch API is hit, the User-Agent is 'git-lfs/2.3.4'. So this would probably ensure maximum interoperability. This still leaves the experimental knob in, just in case. [1] https://bitbucket.org/sdorra/scm-manager/src/095a027178888bc2b819aebfae3d2c192c858030/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/web/GitUserAgentProvider.java?at=default&fileviewer=file-view-default#GitUserAgentProvider.java-117
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 18 Jan 2018 15:59:21 -0500
parents 10e62d5efa73
children b4e1d0654736
files hgext/lfs/blobstore.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/lfs/blobstore.py	Thu Jan 18 15:11:34 2018 -0500
+++ b/hgext/lfs/blobstore.py	Thu Jan 18 15:59:21 2018 -0500
@@ -188,7 +188,7 @@
         self.baseurl = baseurl.rstrip('/')
         useragent = repo.ui.config('experimental', 'lfs.user-agent')
         if not useragent:
-            useragent = 'mercurial/%s git/2.15.1' % util.version()
+            useragent = 'git-lfs/2.3.4 (Mercurial %s)' % util.version()
         self.urlopener = urlmod.opener(ui, authinfo, useragent)
         self.retry = ui.configint('lfs', 'retry')