Skip to content

fix(csp): add 'self' to connect-src so API calls to own origin are allowed#4170

Merged
ildyria merged 1 commit intoLycheeOrg:masterfrom
cdzombak:cdz/fix-csp-self
Mar 10, 2026
Merged

fix(csp): add 'self' to connect-src so API calls to own origin are allowed#4170
ildyria merged 1 commit intoLycheeOrg:masterfrom
cdzombak:cdz/fix-csp-self

Conversation

@cdzombak
Copy link
Contributor

Commit fa1da39 ("Fix Connect src csp #4161") corrected the connect-src config format from a flat array to a structured array, which caused the secure-headers library to actually emit the directive.

However, it omitted 'self' => true, so all XHR/fetch requests to the site's own origin (e.g. /api/v2/*) were blocked by the Content Security Policy.

…lowed

Commit fa1da39 ("Fix Connect src csp LycheeOrg#4161") corrected the connect-src
config format from a flat array to a structured array, which caused the
secure-headers library to actually emit the directive. However, it
omitted 'self' => true, so all XHR/fetch requests to the site's own
origin (e.g. /api/v2/*) were blocked by the Content Security Policy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cdzombak cdzombak requested a review from a team as a code owner March 10, 2026 17:04
@cdzombak
Copy link
Contributor Author

This change was required after pulling the latest master for my website and is currently running at https://pictures.dzombak.com.

@ildyria ildyria merged commit 3e8a718 into LycheeOrg:master Mar 10, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants