浏览代码

perf: optimise set_cors_headers (bp #12460) (#12462)

(cherry picked from commit 68c6fc4a44)

Co-authored-by: Sagar Vora <sagar@resilient.tech>
version-14
mergify[bot] 4 年前
committed by GitHub
父节点
当前提交
7e6ce22d64
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. +2
    -2
      frappe/app.py

+ 2
- 2
frappe/app.py 查看文件

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


正在加载...
取消
保存