Skip to content

Commit

Permalink
Fix hang on Gzip decompression
Browse files Browse the repository at this point in the history
'LimitedInputFilter' should be applied before the Gzip middleware as
'CONTENT_LENGTH' refers to the size of the *compressed* body.  If
applied in wrong order, this may cause 'copyfileobj()' to try to read
more data from the socket than is available, resulting in a call to
'recv()' that hangs forever.
  • Loading branch information
jonashaag committed Apr 12, 2016
1 parent 7b70438 commit 6ba8bba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dulwich/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def make_wsgi_chain(*args, **kwargs):
correctly wrapped with needed middleware.
"""
app = HTTPGitApplication(*args, **kwargs)
wrapped_app = GunzipFilter(LimitedInputFilter(app))
wrapped_app = LimitedInputFilter(GunzipFilter(app))
return wrapped_app


Expand Down

0 comments on commit 6ba8bba

Please sign in to comment.