From 4c8d1b9a7dc909a02fa0304d00b87b664edc385d Mon Sep 17 00:00:00 2001 From: Piotr Dobrogost Date: Mon, 11 Feb 2013 23:07:12 +0100 Subject: [PATCH] removed no longer used redirect codes from models added numeric values of redirect codes in comments --- requests/models.py | 2 -- requests/sessions.py | 7 ++++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/requests/models.py b/requests/models.py index a845b44..c983db0 100644 --- a/requests/models.py +++ b/requests/models.py @@ -14,7 +14,6 @@ import datetime from io import BytesIO from .hooks import default_hooks from .structures import CaseInsensitiveDict -from .status_codes import codes from .auth import HTTPBasicAuth from .cookies import cookiejar_from_dict, get_cookie_header @@ -28,7 +27,6 @@ from .compat import ( cookielib, urlparse, urlunparse, urlsplit, urlencode, str, bytes, StringIO, is_py2, chardet, json, builtin_str, basestring) -REDIRECT_STATI = (codes.moved, codes.found, codes.other, codes.temporary_moved) CONTENT_CHUNK_SIZE = 10 * 1024 ITER_CHUNK_SIZE = 512 diff --git a/requests/sessions.py b/requests/sessions.py index ff70db7..8efcc84 100644 --- a/requests/sessions.py +++ b/requests/sessions.py @@ -24,7 +24,12 @@ from .adapters import HTTPAdapter from .utils import requote_uri, get_environ_proxies, get_netrc_auth from .status_codes import codes -REDIRECT_STATI = (codes.moved, codes.found, codes.other, codes.temporary_moved) +REDIRECT_STATI = ( + codes.moved, # 301 + codes.found, # 302 + codes.other, # 303 + codes.temporary_moved, # 307 +) DEFAULT_REDIRECT_LIMIT = 30 -- 2.7.4