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, matrixise, orsenthil, vstinner
Date 2015-11-26.02:00:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1448503227.74.0.00314783299141.issue21224@psf.upfronthosting.co.za>
In-reply-to
Content
Changing it could break existing code written for the HTTP 1.0 behaviour. The main effect mentioned at <https://docs.python.org/dev/library/http.server.html#http.server.BaseHTTPRequestHandler.protocol_version> is that in HTTP 1.0 mode, a server may send a response without Content-Length, because its connection will be automatically shut down when it is done. In HTTP 1.1 mode, the server code has to manually set close_connection = True (or indicate the end of the response some other way).

Looking at the source code, changing protocol_version to "HTTP/1.1":

* Allows close_connection to be False by default (causing the problem above)
* Enables Expect: 100-continue handling (no problem)
* Changes the version actually used in the HTTP protocol (probably acceptable if everything else keeps working with a HTTP 1.1 client)
* Affects the SERVER_PROTOCOL variable for CGI scripts (unsure of the consequences)

Perhaps one way forward would be to use HTTP 1.1 by default, but still set close_connection = True. But then someone may come along and say Python should support persistent connections by default! It does not seem worth enabling HTTP 1.1 with non-persistent connections as the default.
History
Date User Action Args
2015-11-26 02:00:27martin.pantersetrecipients: + martin.panter, orsenthil, vstinner, matrixise
2015-11-26 02:00:27martin.pantersetmessageid: <1448503227.74.0.00314783299141.issue21224@psf.upfronthosting.co.za>
2015-11-26 02:00:27martin.panterlinkissue21224 messages
2015-11-26 02:00:25martin.pantercreate