Skip to content

Commit

Permalink
file get bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jstzwj committed Sep 1, 2024
1 parent 0f2f650 commit c5d4b8f
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions olah/proxy/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,27 @@ async def _file_realtime_stream(
headers=request_headers,
allow_cache=allow_cache,
)
if status_code != 200:
yield status_code
yield head_info
yield content
if status_code == 404:
yield 404
yield {
"x-error-code": "EntryNotFound",
"x-error-message": "Entry not found",
}
yield "Entry not found"
return
if status_code != 200:
if method.lower() == "head":
yield status_code
yield head_info
yield content
return
elif method.lower() == "get":
yield status_code
yield head_info
yield content
return
else:
raise Exception("Invalid method in _file_realtime_stream parameter.")
except httpx.ConnectError:
yield 504
yield {}
Expand Down

0 comments on commit c5d4b8f

Please sign in to comment.