Repository navigation
Studio CSP: allow the map tiles, check outside origins at build (#559) - #564
Merged
Merged
Conversation
…ild (#559) img-src takes https://tile.openstreetmap.org. scripts/csp-hash.mjs --check (run by the build) now also fails when an app's code loads from an https origin its _headers does not name; links and XML namespaces are left out. The stale Open-Meteo line in docs/infrastructure.md goes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #559
What changed
apps/studio/public/_headers:img-srcalso allowshttps://tile.openstreetmap.org, with a comment saying why.scripts/csp-hash.mjs --check(already run bypnpm build/make check/ CI): it also fails when an app's code (itssrcandpackages/design/src) loads from anhttps://origin that its_headersCSP does not name. Links (href="https://…") and XML namespaces are skipped. Before this fix it failed with:apps/studio/src/places/map.tsx loads from https://tile.openstreetmap.org, which its _headers Content-Security-Policy does not allow. Test:scripts/csp-hash.test.mjs.docs/infrastructure.mdlost its stale Open-Meteo line (the rebuilt Studio calls no weather API, and it was never inconnect-src).docs/development.mddescribes the new check.Decisions
referrerPolicy: "strict-origin-when-cross-origin"itself (places/map.tsx:22), which overrides the page'ssame-origin, so OSM gets the origin._headersis unchanged (the check covers it too).Checked / not checked
make checkgreen. The check failed on the old policy and passes with the fix._headers. After a deploy, a map (Sets/Locations map view or the pin dialog) should show tiles.🤖 Generated with Claude Code