mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-30 11:00:11 +08:00
Access http token for ws connection (#3735)
* Access unsecure token * CHANGELOG --------- Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
This commit is contained in:
parent
b97a61b83a
commit
1981c010c6
@ -8,6 +8,7 @@ No changes to highlight.
|
||||
## Bug Fixes:
|
||||
|
||||
- Increase timeout for sending analytics data by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3647](https://github.com/gradio-app/gradio/pull/3647)
|
||||
- Fix bug where http token was not accessed over websocket connections by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3735](https://github.com/gradio-app/gradio/pull/3735)
|
||||
|
||||
## Documentation Changes:
|
||||
|
||||
|
@ -167,7 +167,9 @@ class App(FastAPI):
|
||||
)
|
||||
|
||||
async def ws_login_check(websocket: WebSocket) -> Optional[str]:
|
||||
token = websocket.cookies.get("access-token")
|
||||
token = websocket.cookies.get("access-token") or websocket.cookies.get(
|
||||
"access-token-unsecure"
|
||||
)
|
||||
return token # token is returned to allow request in queue
|
||||
|
||||
@app.get("/token")
|
||||
|
Loading…
Reference in New Issue
Block a user