mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-06 15:28:28 +01:00
specifically look for Location header in response
This commit is contained in:
+7
-1
@@ -103,7 +103,13 @@ class RemoteHTTP(RemoteBASE):
|
||||
try:
|
||||
res = self._session.request(method, url, **kwargs)
|
||||
|
||||
if kwargs["allow_redirects"] and res.status_code in (301, 302):
|
||||
redirect_no_location = (
|
||||
kwargs["allow_redirects"]
|
||||
and res.status_code in (301, 302)
|
||||
and "location" not in res.headers
|
||||
)
|
||||
|
||||
if redirect_no_location:
|
||||
# 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
|
||||
|
||||
Reference in New Issue
Block a user