Martin Panter added the comment:

I think neither Pierre’s nor Glenn’s implementations should be added to 
SimpleHTTPRequestHandler. In fact I think most forms of content negotiation are 
only appropriate for a higher-level server. It seems too far removed from the 
intention of the class, “directly mapping the directory structure to HTTP 
requests”.

Another concern with Pierre’s proposal is the delay and memory or disk usage 
that would be incurred for a large file (e.g. text/plain log file), especially 
with HEAD requests. I have Linux computers set up with /tmp just held in 
memory, no disk file system nor swap. It would be surprising that a HTTP 
request had to copy the entire file into memory before sending it.

It may be reasonable to serve the Content-Encoding field based on the stored 
file though. If the client requests file “xyz”, there should be no encoding, 
but if the request was explicitly for “xyz.gz”, the server could add 
Content-Encoding. But I suspect this won’t help Pierre.

Some other thoughts on the pull request:
* x-gzip is supposed to be an alias in HTTP 1.1 requests
* The response is HTTP 1.0, where x-gzip seems to be the canonical name
* In HTTP 1.1 requests, consider supporting Accept-Encoding: gzip;q=1
* Accept-Encoding: gzip;q=0
* Accept-Encoding: *
* Accept-Encoding: GZIP (case insensitivity)

----------

_______________________________________
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