Access http token for ws connection (#3735)

* Access unsecure token

* CHANGELOG

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
This commit is contained in:
Freddy Boulton 2023-04-04 06:57:44 -07:00 committed by GitHub
parent b97a61b83a
commit 1981c010c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

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

View File

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