Kaynağa Gözat

Make default user-agent start with git/ to work around github responding 404 otherwise. #562

Jelmer Vernooij 7 yıl önce
ebeveyn
işleme
93549e1598
2 değiştirilmiş dosya ile 11 ekleme ve 1 silme
  1. 8 0
      NEWS
  2. 3 1
      dulwich/client.py

+ 8 - 0
NEWS

@@ -1,3 +1,11 @@
+0.18.4	2017-10-01
+
+ BUG FIXES
+
+  * Make default User-Agent start with "git/" because GitHub won't response to
+    HTTP smart server requests otherwise (and reply with a 404).
+    (Jelmer vernooij, #562)
+
 0.18.3	2017-09-03
 
  BUG FIXES

+ 3 - 1
dulwich/client.py

@@ -1161,7 +1161,9 @@ class SSHGitClient(TraditionalGitClient):
 
 
 def default_user_agent_string():
-    return "dulwich/%s" % ".".join([str(x) for x in dulwich.__version__])
+    # Start user agent with "git/", because GitHub requires this. :-( See
+    # https://github.com/jelmer/dulwich/issues/562 for details.
+    return "git/dulwich/%s" % ".".join([str(x) for x in dulwich.__version__])
 
 
 def default_urllib2_opener(config):