Message299088
I think chunked encoding is only meant to be used for HTTP 1.1. For HTTP 1.0, you have to either send Content-Length, or shut down the connection after sending the body. See also Issue 21224 about improving HTTP 1.1 support.
Maybe you should add a “Vary: accept-encoding” field (even if gzip not acceptable to the client).
I wonder if it is possible to make some of the code more generic? E.g. rather than being coupled to SimpleHTTPRequestHandler, perhaps the chunk encoder, request parsing, etc could also be usable by custom servers. We already have one chunk encoder in “http.client” and an Accept-Encoding parser in “xmlrpc.server”.
FWIW I think using GzipFile should be safe if done right. You would give it a custom writer class that accepted gzip-encoded chunks, added HTTP chunk encoding (for HTTP 1.1), and sent them to the client. IMO this is a more flexible way of doing a chunk encoder. |
|
Date |
User |
Action |
Args |
2017-07-25 14:16:51 | martin.panter | set | recipients:
+ martin.panter, terry.reedy, vstinner, christian.heimes, v+python, r.david.murray, quentel |
2017-07-25 14:16:51 | martin.panter | set | messageid: <1500992211.31.0.398209458575.issue30576@psf.upfronthosting.co.za> |
2017-07-25 14:16:51 | martin.panter | link | issue30576 messages |
2017-07-25 14:16:51 | martin.panter | create | |
|