فهرست منبع

Ignore agent= capability if sent by client.

Jelmer Vernooij 4 سال پیش
والد
کامیت
44704556c2
2فایلهای تغییر یافته به همراه6 افزوده شده و 0 حذف شده
  1. 3 0
      NEWS
  2. 3 0
      dulwich/server.py

+ 3 - 0
NEWS

@@ -5,6 +5,9 @@
  * Only return files from the loose store that look like git objects.
    (Nicolas Dandrimont)
 
+ * Ignore agent= capability if sent by client.
+   (Jelmer Vernooij)
+
 0.19.17	UNRELEASED
 
  * Don't break when encountering block devices.

+ 3 - 0
dulwich/server.py

@@ -73,6 +73,7 @@ from dulwich.protocol import (  # noqa: F401
     BufferedPktLineWriter,
     capability_agent,
     CAPABILITIES_REF,
+    CAPABILITY_AGENT,
     CAPABILITY_DELETE_REFS,
     CAPABILITY_INCLUDE_TAG,
     CAPABILITY_MULTI_ACK_DETAILED,
@@ -258,6 +259,8 @@ class PackHandler(Handler):
         allowable_caps = set(self.innocuous_capabilities())
         allowable_caps.update(self.capabilities())
         for cap in caps:
+            if cap.startswith(CAPABILITY_AGENT + b'='):
+                continue
             if cap not in allowable_caps:
                 raise GitProtocolError('Client asked for capability %s that '
                                        'was not advertised.' % cap)