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

This commit is contained in:
Georg Brandl 2007-09-24 18:08:24 +00:00
parent e4186252b1
commit 9b915673b7
1 changed files with 3 additions and 1 deletions

View File

@ -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: