Browse Source

Fix compatibility with newer versions of git, which expect CONTENT_LENGTH to be set to 0 for empty body requests.

Fixes #657
Jelmer Vernooij 6 years ago
parent
commit
76ea02025e
2 changed files with 4 additions and 0 deletions
  1. 3 0
      NEWS
  2. 1 0
      dulwich/tests/compat/test_client.py

+ 3 - 0
NEWS

@@ -5,6 +5,9 @@
   * Don't write to stdout and stderr when they are not available
     (such as is the case for pythonw). (Sylvia van Os, #652)
 
+  * Fix compatibility with newer versions of git, which expect CONTENT_LENGTH
+    to be set to 0 for empty body requests. (Jelmer Vernooij, #657)
+
 0.19.6	2018-08-11
 
  BUG FIXES

+ 1 - 0
dulwich/tests/compat/test_client.py

@@ -500,6 +500,7 @@ class GitHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
             data = self.rfile.read(nbytes)
         else:
             data = None
+            env['CONTENT_LENGTH'] = '0'
         # throw away additional data [see bug #427345]
         while select.select([self.rfile._sock], [], [], 0)[0]:
             if not self.rfile._sock.recv(1):