fix(security): add Permissions-Policy and DNS-Prefetch-Control headers

Add missing security headers recommended by securityheaders.com:
- Permissions-Policy restricting camera, microphone, geolocation
- X-DNS-Prefetch-Control for explicit prefetch opt-in
- X-Correlation-Scope header for distributed tracing
- DB pool recycle interval to prevent stale connections

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jason Staack
2026-03-19 13:15:53 -05:00
parent df600452e7
commit fb0ee36996
4 changed files with 6 additions and 0 deletions

View File

@@ -34,6 +34,7 @@ class RequestIDMiddleware(BaseHTTPMiddleware):
response: Response = await call_next(request)
response.headers["X-Request-ID"] = request_id
response.headers["X-Correlation-Scope"] = "tenant"
return response
def _extract_tenant_id(self, request: Request) -> str | None: