Opus finding
Middleware matcher still applies security headers to image/asset routes via negative lookahead on URL suffix only
lowmaintainabilitymedium
- apps/web/middleware.ts:52-56
The matcher excludes png/svg/ico via suffix patterns but leaves jpg, jpeg, gif, webp, woff/woff2, css, js, and map files in scope. That is probably intentional (the comment says API routes should benefit), but as written the asset-exclusion is inconsistent: an SVG is excluded while a JPG is not, despite both being non-HTML responses where CSP/HSTS provide little value and where misconfiguration (e.g., a CDN re-serving with stale headers) could cause confusion. Minor consistency issue worth flagging.
Recommendation
Either expand the suffix list to include common asset extensions (jpg|jpeg|gif|webp|woff2?|css|js|map) or document that the omission is deliberate.