From 5179f622df56c5f863c5f012616caad058ea492a Mon Sep 17 00:00:00 2001 From: jstzwj <1103870790@qq.com> Date: Sun, 11 Aug 2024 05:24:10 +0800 Subject: [PATCH] cache request header bug fix when it is a redirection --- olah/proxy/files.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/olah/proxy/files.py b/olah/proxy/files.py index b6bda91..715a0ae 100644 --- a/olah/proxy/files.py +++ b/olah/proxy/files.py @@ -167,12 +167,6 @@ async def _file_full_header( response.content, ) elif response.status_code >= 300 and response.status_code <= 399: - await _write_cache_request( - head_path, - response.status_code, - response_headers_dict, - response.content, - ) from_url = urlparse(url) parsed_url = urlparse(response.headers["location"]) if len(parsed_url.netloc) != 0: @@ -192,6 +186,12 @@ async def _file_full_header( ORIGINAL_LOC, response.headers["location"], ) + await _write_cache_request( + head_path, + response.status_code, + response_headers_dict, + response.content, + ) elif response.status_code == 403: pass else: