Commit Diff


commit - 4fbb4e6969fd7860759cdd191e2d585086417182
commit + 877095b47a6c8685833a4b2c9b3d09274ca7bfdc
blob - 31f3970af410b53cdcc7e26ebfabc987a0df5e61
blob + 91d1a2616c64a9c562df7d7c73f0aa88c853fc94
--- NEWS
+++ NEWS
@@ -7,6 +7,10 @@
 
  * Increase tolerance when comparing time stamps; fixes some
    spurious test failures on slow CI systems. (Jelmer Vernooij)
+
+ * Revert removal of caching of full HTTP response. This breaks
+   access to some HTTP servers.
+   (Jelmer Vernooij)
 
 0.20.37	2022-05-16
 
blob - da39847fd9a87b55175e2b7890d58abed6abe2b3
blob + 9120e51f673806fb2e2463068b7762ae3c89840e
--- dulwich/client.py
+++ dulwich/client.py
@@ -2232,7 +2232,9 @@ class Urllib3HttpGitClient(AbstractHttpGitClient):
             resp.redirect_location = resp.get_redirect_location()
         else:
             resp.redirect_location = resp_url if resp_url != url else ""
-        return resp, resp.read
+        # TODO(jelmer): Remove BytesIO() call that caches entire response in
+        # memory. See https://github.com/jelmer/dulwich/issues/966
+        return resp, BytesIO(resp.data).read
 
 
 HttpGitClient = Urllib3HttpGitClient