修复调试接口被拦截bug

This commit is contained in:
2026-04-21 15:20:36 +08:00
parent 186ba0ecef
commit fcf143593a

View File

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