Skip to content

Commit

Permalink
cache request header bug fix when it is a redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
jstzwj committed Aug 10, 2024
1 parent 6aace71 commit 5179f62
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions olah/proxy/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 5179f62

Please sign in to comment.