fix: optimise set_cors_headers
This commit is contained in:
parent
db88902a70
commit
68c6fc4a44
1 changed files with 2 additions and 2 deletions
|
|
@ -152,10 +152,10 @@ def process_response(response):
|
|||
|
||||
def set_cors_headers(response):
|
||||
origin = frappe.request.headers.get('Origin')
|
||||
if not origin:
|
||||
allow_cors = frappe.conf.allow_cors
|
||||
if not (origin and allow_cors):
|
||||
return
|
||||
|
||||
allow_cors = frappe.conf.allow_cors
|
||||
if allow_cors != "*":
|
||||
if not isinstance(allow_cors, list):
|
||||
allow_cors = [allow_cors]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue