Add Content-Security-Policy headers - #418
Open
TameTheGame wants to merge 1 commit into
Open
Conversation
TameTheGame
marked this pull request as ready for review
August 29, 2026 14:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds the three Content Security Policy directives proposed in #385 to every response from both Gokapi HTTP servers:
frame-ancestors 'none'; object-src 'none'; base-uri 'self'The main application gives only
/serviceworker/index.htmla narrowly scopedframe-ancestors 'self'exception because the HTTPS client-side encrypted-download flow loads that StreamSaver document in a hidden same-origin iframe. Inline-served uploaded files retain their existingsandboxpolicy as an additional, cumulative CSP policy.Closes #385.
Type of Change
Technical Details
How Has This Been Tested?
test,awsmockandtest,noawsbuild tags.go generate ./...,go fmt ./..., andgit diff --checkalso pass.The complete Windows
go test ./...run was attempted. It reaches unrelated pre-existing Windows-specific failures involving path separators, locked SQLite/test files, certificate-day rounding, and an address-binding test; the address-binding failure reproduces unchanged on the exact base commit. The pull request's Linux CI matrix is the authoritative full-suite result.Checklist