authorization: set private network CORS header
In the future, an `Access-Control-Request-Private-Network` header will be sent with these requests, and servers must respond with `Access-Control-Allow-Private-Network`. This will start with the next Chrome version (104), and Mozilla has marked the standard as "worth prototyping", which often leads to final implementation. Signed-off-by: Franklyn Tackitt <git@frank.af>
This commit is contained in:
parent
9fea1634b1
commit
7cd29c068d
|
@ -799,6 +799,11 @@ class Authorization:
|
|||
"Origin, Accept, Content-Type, X-Requested-With, "
|
||||
"X-CRSF-Token, Authorization, X-Access-Token, "
|
||||
"X-Api-Key")
|
||||
if req_hdlr.request.headers.get(
|
||||
"Access-Control-Request-Private-Network", None) == "true":
|
||||
req_hdlr.set_header(
|
||||
"Access-Control-Allow-Private-Network",
|
||||
"true")
|
||||
|
||||
def cors_enabled(self) -> bool:
|
||||
return self.cors_domains is not None
|
||||
|
|
Loading…
Reference in New Issue