This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients christian.heimes, martin.panter, quentel, r.david.murray, terry.reedy, v+python, vstinner
Date 2017-07-25.14:16:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1500992211.31.0.398209458575.issue30576@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-07-25 14:16:51martin.pantersetrecipients: + martin.panter, terry.reedy, vstinner, christian.heimes, v+python, r.david.murray, quentel
2017-07-25 14:16:51martin.pantersetmessageid: <1500992211.31.0.398209458575.issue30576@psf.upfronthosting.co.za>
2017-07-25 14:16:51martin.panterlinkissue30576 messages
2017-07-25 14:16:51martin.pantercreate