修复调试接口被拦截bug
This commit is contained in:
@@ -30,14 +30,16 @@ PUBLIC_PATHS = [
|
||||
r'^/health$',
|
||||
r'^/api/auth/login$',
|
||||
r'^/api/auth/logout$',
|
||||
r'^/debug/.*$', # 调试入口
|
||||
]
|
||||
|
||||
def is_public_path(path: str) -> bool:
|
||||
"""检查是否为公开路径"""
|
||||
for pattern in PUBLIC_PATHS:
|
||||
if re.match(pattern, path):
|
||||
return True
|
||||
# 动态匹配调试入口路径
|
||||
if settings.DEBUG_PATH and path == settings.DEBUG_PATH:
|
||||
return True
|
||||
return False
|
||||
return False
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user