forked from mirror/MrDoc
配置文件支持设置CSRF可信来源
This commit is contained in:
parent
e43183212a
commit
df5d2a3f96
@ -248,6 +248,13 @@ X_FRAME_OPTIONS = CONFIG.get("x_frame","option",fallback='SAMEORIGIN')
|
||||
|
||||
DATA_UPLOAD_MAX_MEMORY_SIZE = None
|
||||
|
||||
# CSRF 可信来源
|
||||
csrf_str = CONFIG.get("csrf_origin","allow",fallback=[])
|
||||
if csrf_str == []:
|
||||
CSRF_TRUSTED_ORIGINS = csrf_str
|
||||
else:
|
||||
CSRF_TRUSTED_ORIGINS = csrf_str.split(',')
|
||||
|
||||
# 跨域请求配置
|
||||
cors_str = CONFIG.get("cors_origin","allow",fallback=[])
|
||||
capacitor_origins = ['http://localhost','capacitor://localhost']
|
||||
|
Loading…
x
Reference in New Issue
Block a user