Add baseline security headers; exempt doc-serving routes (L-3) #115
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
qwc-open/asiakirjat!115
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/security-headers"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
SecurityHeadersMiddlewaresetsX-Content-Type-Options: nosniff,Referrer-Policy: strict-origin-when-cross-origin, andContent-Security-Policy: frame-ancestors 'self'on app-owned UI responses (admin, login, profile, upload, API, project pages, frontpage).GET /project/{slug}/{version}/{path...}) are exempt because uploaded HTML may legitimately use inline scripts, embed third-party origins, or be intentionally framed./project/{slug}/version/{tag}/{action}action routes (delete, pin, download) keep the headers because their second segment is the literal"version".Test plan
go test ./internal/handler/...— newTestSecurityHeadersMiddlewarecovers admin, login, profile, upload, version-action, download, API, frontpage, doc-serving exemption (with and without nested paths), and base-path variants.go test ./...— full suite still green.go build— clean.Audit item: L-3 (Low / Sec).
🤖 Generated with Claude Code