mirror of
https://github.com/gradio-app/gradio.git
synced 2024-11-27 01:40:20 +08:00
Favicon fix for Windows (#4369)
* favicon fix * changelog * svg * remove favicon * actual fix
This commit is contained in:
parent
cd64130d54
commit
31a8cfbf74
@ -10,6 +10,7 @@
|
||||
- Make `Blocks.load` behave like other event listeners (allows chaining `then` off of it) [@anentropic](https://github.com/anentropic/) in [PR 4304](https://github.com/gradio-app/gradio/pull/4304)
|
||||
- Respect `interactive=True` in output components of a `gr.Interface` by [@abidlabs](https://github.com/abidlabs) in [PR 4356](https://github.com/gradio-app/gradio/pull/4356).
|
||||
- Remove unused frontend code by [@akx](https://github.com/akx) in [PR 4275](https://github.com/gradio-app/gradio/pull/4275)
|
||||
- Fixes favicon path on Windows by [@abidlabs](https://github.com/abidlabs) in [PR 4369](https://github.com/gradio-app/gradio/pull/4369).
|
||||
- Prevent path traversal in `/file` routes by [@abidlabs](https://github.com/abidlabs) in [PR 4370](https://github.com/gradio-app/gradio/pull/4370).
|
||||
- Do not send HF token to other domains via `/proxy` route by [@abidlabs](https://github.com/abidlabs) in [PR 4368](https://github.com/gradio-app/gradio/pull/4368).
|
||||
|
||||
|
@ -8,6 +8,7 @@ import inspect
|
||||
import json
|
||||
import mimetypes
|
||||
import os
|
||||
import posixpath
|
||||
import secrets
|
||||
import tempfile
|
||||
import traceback
|
||||
@ -628,7 +629,7 @@ def safe_join(directory: str, path: str) -> str:
|
||||
if path == "":
|
||||
raise HTTPException(400)
|
||||
|
||||
filename = os.path.normpath(path)
|
||||
filename = posixpath.normpath(path)
|
||||
fullpath = os.path.join(directory, filename)
|
||||
if (
|
||||
any(sep in filename for sep in _os_alt_seps)
|
||||
|
@ -56,6 +56,10 @@ class TestRoutes:
|
||||
response = test_client.get("/config/")
|
||||
assert response.status_code == 200
|
||||
|
||||
def test_favicon_route(self, test_client):
|
||||
response = test_client.get("/favicon.ico")
|
||||
assert response.status_code == 200
|
||||
|
||||
def test_upload_path(self, test_client):
|
||||
with open("test/test_files/alphabet.txt") as f:
|
||||
response = test_client.post("/upload", files={"files": f})
|
||||
|
Loading…
Reference in New Issue
Block a user