update redirect check

This commit is contained in:
Fábio Santos
2020-01-16 14:34:09 +00:00
parent d3f925ae63
commit c5eb13c114
+1 -1
View File
@@ -103,7 +103,7 @@ class RemoteHTTP(RemoteBASE):
try:
res = self._session.request(method, url, **kwargs)
if kwargs["allow_redirects"] and res.is_redirect:
if kwargs["allow_redirects"] and res.status_code in (301, 302):
# AWS s3 doesn't like to add a location header to its redirects
# from https://s3.amazonaws.com/<bucket name>/* type URLs.
# This should be treated as an error