mirror of
https://github.com/gradio-app/gradio.git
synced 2024-11-21 01:01:05 +08:00
Fixed old files route (#3010)
* fixed files route * changelog * formatting
This commit is contained in:
parent
cab8d888dc
commit
f7f5398e4c
@ -12,6 +12,7 @@ No changes to highlight.
|
||||
* Fixes bug where png files were not being recognized when uploading images by [@abidlabs](https://github.com/abidlabs) in [PR 3002](https://github.com/gradio-app/gradio/pull/3002)
|
||||
* Fixes bug where temporary uploaded files were not being added to temp sets by [@abidlabs](https://github.com/abidlabs) in [PR 3005](https://github.com/gradio-app/gradio/pull/3005)
|
||||
* Fixes issue where markdown support in chatbot breaks older demos [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3006](https://github.com/gradio-app/gradio/pull/3006)
|
||||
* Fixes the `/file/` route that was broken in a recent change in [PR 3010](https://github.com/gradio-app/gradio/pull/3010)
|
||||
* Fix bug where the Image component could not serialize image urls by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2957](https://github.com/gradio-app/gradio/pull/2957)
|
||||
|
||||
## Documentation Changes:
|
||||
|
@ -289,8 +289,8 @@ class App(FastAPI):
|
||||
)
|
||||
|
||||
@app.get("/file/{path:path}", dependencies=[Depends(login_check)])
|
||||
def file_deprecated(path: str, request: fastapi.Request):
|
||||
return file(path, request)
|
||||
async def file_deprecated(path: str, request: fastapi.Request):
|
||||
return await file(path, request)
|
||||
|
||||
@app.post("/reset/")
|
||||
@app.post("/reset")
|
||||
|
@ -203,6 +203,9 @@ class TestRoutes:
|
||||
file_response = client.get(f"/file={created_file}")
|
||||
assert file_response.is_success
|
||||
|
||||
backwards_compatible_file_response = client.get(f"/file/{created_file}")
|
||||
assert backwards_compatible_file_response.is_success
|
||||
|
||||
file_response_with_full_range = client.get(
|
||||
f"/file={created_file}", headers={"Range": "bytes=0-"}
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user