Martin Panter added the comment:

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.

----------

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

Reply via email to