← Back to team overview

dulwich-users team mailing list archive

[PATCH] Support for gzip-encoded data in wsgi server

 

Attached is a patch that allows the WSGI server to transparently
decompress incoming requests that use Content-Encoding: gzip. With
this patch, I can now serve the dulwich git repo with dul-web and
successfully clone it with c git.

The relevant bits are in dulwich/web.py (GunzipFilter and
LengthLimitedInput). They both are implemented as simple WSGI
middleware apps that operate on wsgi.input. I had to retain the logic
in handle_service_request to ensure that wsgi.input was limited, as
tests in compat/ would start mysteriously hanging without it.

I added a GunzipTestCase as well, and in so doing restructured
HTTPGitApplicationTestCase to be able to share some of its logic for
setting up a simple scenario.

-- 
Thanks,

David Blewett

Attachment: gzipfilter.diff
Description: Binary data


Follow ups