summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlaf Conradi <olaf@conradi.org>2013-09-11 20:29:06 +0200
committerOlaf Conradi <olaf@conradi.org>2013-09-11 20:29:06 +0200
commita4612bbd90e0ba6ab67ce9d26a5e171922e09d98 (patch)
tree34d7456a759be0a630abf3390dabde143ce98595
parent4756e31adc007d64a5eb5bc62009a26e272a2c51 (diff)
downloadurllib3-a4612bbd90e0ba6ab67ce9d26a5e171922e09d98.tar.gz
Support redirect on 308
As http://greenbytes.de/tech/webdav/draft-reschke-http-status-308-07.html has been accepted by IESG (but is still waiting for official publication).
-rw-r--r--urllib3/connectionpool.py2
-rw-r--r--urllib3/response.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/urllib3/connectionpool.py b/urllib3/connectionpool.py
index b46871cd..e8764341 100644
--- a/urllib3/connectionpool.py
+++ b/urllib3/connectionpool.py
@@ -399,7 +399,7 @@ class HTTPConnectionPool(ConnectionPool, RequestMethods):
:param redirect:
If True, automatically handle redirects (status codes 301, 302,
- 303, 307). Each redirect counts as a retry.
+ 303, 307, 308). Each redirect counts as a retry.
:param assert_same_host:
If ``True``, will make sure that the host of the pool requests is
diff --git a/urllib3/response.py b/urllib3/response.py
index c7f93b82..3cd01772 100644
--- a/urllib3/response.py
+++ b/urllib3/response.py
@@ -107,7 +107,7 @@ class HTTPResponse(io.IOBase):
code and valid location. ``None`` if redirect status and no
location. ``False`` if not a redirect status code.
"""
- if self.status in [301, 302, 303, 307]:
+ if self.status in [301, 302, 303, 307, 308]:
return self.headers.get('location')
return False