Martin Panter added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30576>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to