feat: frontend error capture — diagnostic instantané pour Hermes
- app.js: intercepte window.onerror + unhandledrejection Envoie automatiquement au backend via POST /api/frontend-error Déduplication, throttling 1/sec, max 50 erreurs buffer local window.__flowdeck_errors accessible en console debug - api.py: 2 nouvelles routes POST /api/frontend-error — reçoit erreurs JS, déduplique, logge GET /api/frontend-errors?clear=true — Hermes lit les erreurs - csrf.py: exemption /api/frontend-error du CSRF Usage Hermes après chaque déploiement: curl -s http://localhost:8080/api/frontend-errors | jq . → Voir TOUTES les erreurs JS en temps réel
This commit is contained in:
@@ -16,7 +16,7 @@ class CSRFMiddleware(BaseHTTPMiddleware):
|
||||
"""
|
||||
|
||||
SAFE_METHODS = {"GET", "HEAD", "OPTIONS"}
|
||||
EXCLUDED_PATHS = {"/api/webhook", "/api/v1", "/auth/callback", "/auth/register", "/auth/local-login", "/api/user", "/board/api/pages", "/board/api/favorites", "/api/workspace", "/api/local-workspace", "/api/settings", "/db/", "/workspace"}
|
||||
EXCLUDED_PATHS = {"/api/webhook", "/api/v1", "/auth/callback", "/auth/register", "/auth/local-login", "/api/user", "/board/api/pages", "/board/api/favorites", "/api/workspace", "/api/local-workspace", "/api/settings", "/db/", "/workspace", "/api/frontend-error"}
|
||||
|
||||
async def dispatch(self, request: Request, call_next):
|
||||
# Webhook receiver, OAuth callback, and internal API are exempt
|
||||
|
||||
Reference in New Issue
Block a user