Commit 9b915673 authored by Georg Brandl's avatar Georg Brandl

#1177: accept 2xx responses for https too, not only http.

parent e4186252
......@@ -435,7 +435,9 @@ class URLopener:
# something went wrong with the HTTP status line
raise IOError, ('http protocol error', 0,
'got a bad status line', None)
if errcode == 200:
# According to RFC 2616, "2xx" code indicates that the client's
# request was successfully received, understood, and accepted.
if not (200 <= errcode < 300):
return addinfourl(fp, headers, "https:" + url)
else:
if data is None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment