From 929a1e79b5ea37565ad79561a7524e584645029c Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 1 Apr 2026 09:56:11 +0200 Subject: [PATCH 1/4] also handle 404 status for download --- ayon_api/server_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ayon_api/server_api.py b/ayon_api/server_api.py index 6b007c26b..6a5a0bc89 100644 --- a/ayon_api/server_api.py +++ b/ayon_api/server_api.py @@ -1838,7 +1838,7 @@ def _upload_file( **kwargs ) # Auto-fix missing 'api/' - if response.status_code == 405 and not api_prepended: + if response.status_code in (404, 405) and not api_prepended: api_prepended = True if ( not endpoint.startswith(self._base_url) From f6f1cf889dceff53fd0aad99093c79a38720319c Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 1 Apr 2026 10:08:34 +0200 Subject: [PATCH 2/4] correct the statuses --- ayon_api/server_api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ayon_api/server_api.py b/ayon_api/server_api.py index 6a5a0bc89..1d345f12d 100644 --- a/ayon_api/server_api.py +++ b/ayon_api/server_api.py @@ -1408,7 +1408,7 @@ def _download_file_to_stream( try: with get_func(url, **kwargs) as response: # Auto-fix missing 'api/' - if response.status_code == 405 and not api_prepended: + if response.status_code == 404 and not api_prepended: api_prepended = True if ( not endpoint.startswith(self._base_url) @@ -1838,7 +1838,7 @@ def _upload_file( **kwargs ) # Auto-fix missing 'api/' - if response.status_code in (404, 405) and not api_prepended: + if response.status_code in 405 and not api_prepended: api_prepended = True if ( not endpoint.startswith(self._base_url) From b687aa1b067dcfe8ed91199bbaab765b4643a550 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 1 Apr 2026 10:09:17 +0200 Subject: [PATCH 3/4] fix condition --- ayon_api/server_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ayon_api/server_api.py b/ayon_api/server_api.py index 1d345f12d..84816c388 100644 --- a/ayon_api/server_api.py +++ b/ayon_api/server_api.py @@ -1838,7 +1838,7 @@ def _upload_file( **kwargs ) # Auto-fix missing 'api/' - if response.status_code in 405 and not api_prepended: + if response.status_code == 405 and not api_prepended: api_prepended = True if ( not endpoint.startswith(self._base_url) From 921294cc37cb7d1c49f92d2d67717582c9198a16 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 1 Apr 2026 13:58:24 +0200 Subject: [PATCH 4/4] check for both statuses in both cases --- ayon_api/server_api.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ayon_api/server_api.py b/ayon_api/server_api.py index fda8f1aad..b4287e625 100644 --- a/ayon_api/server_api.py +++ b/ayon_api/server_api.py @@ -1408,7 +1408,10 @@ def _download_file_to_stream( try: with get_func(url, **kwargs) as response: # Auto-fix missing 'api/' - if response.status_code == 404 and not api_prepended: + if ( + response.status_code in (404, 405) + and not api_prepended + ): api_prepended = True if ( not endpoint.startswith(self._base_url) @@ -1841,7 +1844,7 @@ def _upload_file( **kwargs ) # Auto-fix missing 'api/' - if response.status_code == 405 and not api_prepended: + if response.status_code in (404, 405) and not api_prepended: api_prepended = True if ( not endpoint.startswith(self._base_url)