Fixed old files route (#3010)

* fixed files route

* changelog

* formatting
This commit is contained in:
Abubakar Abid 2023-01-18 10:13:29 -08:00 committed by GitHub
parent cab8d888dc
commit f7f5398e4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View File

@ -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:

View File

@ -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")

View File

@ -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-"}
)