diff options
author | Joe Gregorio <jcgregorio@google.com> | 2011-02-14 23:30:21 -0500 |
---|---|---|
committer | Joe Gregorio <jcgregorio@google.com> | 2011-02-14 23:30:21 -0500 |
commit | 1ed2035686903f1c7b342ddc174e81ac588da535 (patch) | |
tree | 5553173f970de328fec86c2b8525ce8b20f875a1 /python3/httplib2 | |
parent | 7c9736950ff36769bbb25ae399dfa5dd14ad813f (diff) | |
download | httplib2-1ed2035686903f1c7b342ddc174e81ac588da535.tar.gz |
Fixes issue 98.
Diffstat (limited to 'python3/httplib2')
-rw-r--r-- | python3/httplib2/__init__.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/python3/httplib2/__init__.py b/python3/httplib2/__init__.py index 2bcdc53..0e7184f 100644 --- a/python3/httplib2/__init__.py +++ b/python3/httplib2/__init__.py @@ -992,7 +992,7 @@ the same interface as FileCache.""" (response, content) = self.request(location, redirect_method, body=body, headers = headers, redirections = redirections - 1) response.previous = old_response else: - raise RedirectLimit( _("Redirected more times than rediection_limit allows."), response, content) + raise RedirectLimit("Redirected more times than redirection_limit allows.", response, content) elif response.status in [200, 203] and method == "GET": # Don't cache 206's since we aren't going to handle byte range requests if 'content-location' not in response: @@ -1112,6 +1112,8 @@ a string that contains the response entity body. if cached_value and method in ["GET", "HEAD"] and self.cache and 'range' not in headers: if '-x-permanent-redirect-url' in info: # Should cached permanent redirects be counted in our redirection count? For now, yes. + if redirections <= 0: + raise RedirectLimit("Redirected more times than redirection_limit allows.", {}, "") (response, new_content) = self.request(info['-x-permanent-redirect-url'], "GET", headers = headers, redirections = redirections - 1) response.previous = Response(info) response.previous.fromcache = True |