mirror of
https://github.com/gradio-app/gradio.git
synced 2025-03-31 12:20:26 +08:00
Perform CORS validation when the request has a cookie (#8743)
* Perform CORS validation when the request has a cookie * add changeset --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
parent
a9307c6452
commit
ee497d5c3c
5
.changeset/fifty-wings-sip.md
Normal file
5
.changeset/fifty-wings-sip.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"gradio": minor
|
||||
---
|
||||
|
||||
feat:Perform CORS validation when the request has a cookie
|
@ -744,9 +744,8 @@ class CustomCORSMiddleware:
|
||||
message.setdefault("headers", [])
|
||||
headers = MutableHeaders(scope=message)
|
||||
headers.update(self.simple_headers)
|
||||
has_cookie = "cookie" in request_headers
|
||||
origin = request_headers["Origin"]
|
||||
if has_cookie or self.is_valid_origin(request_headers):
|
||||
if self.is_valid_origin(request_headers):
|
||||
self.allow_explicit_origin(headers, origin)
|
||||
await send(message)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user