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 martin.panter, quentel, v+python
Date 2017-06-18.00:58:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1497747503.85.0.947803566208.issue30576@psf.upfronthosting.co.za>
In-reply-to
Content
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)
History
Date User Action Args
2017-06-18 00:58:23martin.pantersetrecipients: + martin.panter, v+python, quentel
2017-06-18 00:58:23martin.pantersetmessageid: <1497747503.85.0.947803566208.issue30576@psf.upfronthosting.co.za>
2017-06-18 00:58:23martin.panterlinkissue30576 messages
2017-06-18 00:58:22martin.pantercreate