[issue27299] urllib does not splitport while putrequest realhost to HTTP headers

2016-06-11 Thread gr zhang
gr zhang added the comment: Yes, I mean when set h.putheader('Host', "www.github.com:443") and the status code from httplib will be 405 while when set h.putheader('Host', "www.github.com") the code will be 200, this is confused to me. -- __

[issue27299] urllib does not splitport while putrequest realhost to HTTP headers

2016-06-11 Thread gr zhang
New submission from gr zhang: h.putheader('Host', "www.github.com:443") # this will make errcode 405, if urllib lib splitport first, and this will set Host ---> www.github.com and get 200 code. h.endheaders(None) errcode, errmsg, headers = h.g