[issue30576] http.server should support HTTP compression (gzip)

Pierre Quentel report at bugs.python.org
Wed Aug 2 13:02:28 EDT 2017


Pierre Quentel added the comment:

In the latest version of the PR, following Martin's comments :
- apply Chunk Transfer for HTTP/1.1 only, change implementation of compression for previous protocols (send gzipped data without Content-Length)
- use http.cookiejar to parse the Accept-Encoding header
- fix a bug with chunk length (conversion to hex)
- support x-gzip besides gzip
- handle Python builds without zlib / gzip

Headers parsing is done in several places in the standard distribution. It should probably be done in a single module, but I think it would be better to open a new issue for that, as it would impact more modules than just http.server.

I couldn't find a simple way to reuse code from http.client to generate HTTP chunks (it's in HTTPConnection._send_output()), but I'm not sure it's worth it, the code to generate a chunk is a one-liner.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30576>
_______________________________________


More information about the Python-bugs-list mailing list