Message300285
On Python-ideas someone asked if other compressions could be supported besides gzip.
The latest version of the PR adds a mechanism for that : SimpleHTTPRequestHandler has a new attribute "compressions", a dictionary that maps compression encodings (eg "gzip") to a "compressed data generator". The generator takes a file object as argument, yields non-empty chunks of compressed data and ends by yielding b'' for compliance with Chunked Transfer Encoding protocol.
To support other compression algorithms, "compressions" can be extended with another key (eg "brotli") mapped to the appropriate generator. A test has been added with the non-standard "bzip2" encoding, using the bz2 module in the standard distribution.
I also added support for "deflate" by default (it's very close to "gzip"). |
|
Date |
User |
Action |
Args |
2017-08-15 08:00:02 | quentel | set | recipients:
+ quentel, terry.reedy, vstinner, christian.heimes, v+python, r.david.murray, martin.panter |
2017-08-15 08:00:02 | quentel | set | messageid: <1502784002.24.0.135028087518.issue30576@psf.upfronthosting.co.za> |
2017-08-15 08:00:02 | quentel | link | issue30576 messages |
2017-08-15 08:00:01 | quentel | create | |
|