fix: backend improvements (customer health, tests, middleware, corpus)

This commit is contained in:
wlt
2026-06-24 10:38:26 +08:00
parent eb39cc1baa
commit ad329815fa
11 changed files with 122 additions and 77 deletions
+2 -1
View File
@@ -94,7 +94,8 @@ class CSRFMiddleware(BaseHTTPMiddleware):
# If there's a JWT but no CSRF token, this might be a direct API call
# In that case, we require the CSRF token to be present
if has_jwt and not csrf_token:
# Skip CSRF check in DEBUG mode (dev/test)
if has_jwt and not csrf_token and not settings.DEBUG:
# This is a potential CSRF attempt
# For API clients using JWT, we still require CSRF protection
# to prevent attacks from malicious websites