Skip to content

Commit 404b60e

Browse files
authored
Merge pull request #317 from ynput/bugfix/auto-fix-api-for-download
Download: Autofix download api prefix
2 parents 6b0c965 + 921294c commit 404b60e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

ayon_api/server_api.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,10 @@ def _download_file_to_stream(
14081408
try:
14091409
with get_func(url, **kwargs) as response:
14101410
# Auto-fix missing 'api/'
1411-
if response.status_code == 405 and not api_prepended:
1411+
if (
1412+
response.status_code in (404, 405)
1413+
and not api_prepended
1414+
):
14121415
api_prepended = True
14131416
if (
14141417
not endpoint.startswith(self._base_url)
@@ -1841,7 +1844,7 @@ def _upload_file(
18411844
**kwargs
18421845
)
18431846
# Auto-fix missing 'api/'
1844-
if response.status_code == 405 and not api_prepended:
1847+
if response.status_code in (404, 405) and not api_prepended:
18451848
api_prepended = True
18461849
if (
18471850
not endpoint.startswith(self._base_url)

0 commit comments

Comments
 (0)