Skip to content

chore: update config reference#15658

Merged
ematipico merged 2 commits intomainfrom
chore/update-config-reference
Feb 25, 2026
Merged

chore: update config reference#15658
ematipico merged 2 commits intomainfrom
chore/update-config-reference

Conversation

@ematipico
Copy link
Member

Changes

Updates the configuration reference of CSP

Testing

N/A

Docs

/cc @withastro/maintainers-docs for feedback!

@changeset-bot
Copy link

changeset-bot bot commented Feb 25, 2026

⚠️ No Changeset found

Latest commit: 9095b19

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added pkg: astro Related to the core `astro` package (scope) docs pr labels Feb 25, 2026
* - [Astro's view transitions](https://v6.docs.astro.build/en/guides/view-transitions/) using the `<ClientRouter />` are not supported, but you can [consider migrating to the browser native View Transition API](https://events-3bg.pages.dev/jotter/astro-view-transitions/) instead if you are not using Astro's enhancements to the native View Transitions and Navigation APIs.
* - Shiki isn't currently supported. By design, Shiki functions using inline styles.
* - Shiki isn't currently supported. By design, Shiki functions use inline styles that cannot work with Astro CSP implementation. Consider [using `<Prism />`](https://v6.docs.astro.build/en/guides/syntax-highlighting/#prism-) when your project requires both CSP and syntax highlighting.
* - `unsafe-inline` directives can't work with how Astro implements CSP.
Copy link
Member

@sarah11918 sarah11918 Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* - `unsafe-inline` directives can't work with how Astro implements CSP.
* - `unsafe-inline` directives are incompatible with Astro's CSP implementation. By default, Astro will emit hashes for all its bundled scripts (e.g. client islands) and all modern browsers will automatically reject `unsafe-inline` when it occurs in a directive with a hash or nonce.

Does this sound OK? And, do you think the external link is helpful?

Updated to remove the link, and with a possible idea for a second sentence if you want one! (The first sentence on its own is complete. I'll leave it your call whether you'd also like a second sentence with more details! (You can also edit the sentence if it needs fixing!)

Copy link
Member Author

@ematipico ematipico Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very direct. Yeah that works

And, do you think the external link is helpful?

Not really, it doesn't actually address the real reason why unsafe-inline doesn't work with Astro implementation.

here is briefly mentioned, but for nonce

If a directive contains a nonce and unsafe-inline, then the browser ignores unsafe-inline.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, then I'll update my suggestion to remove the link! I'll put back your second line and you can decide whether you want that too, or just the first line!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless we want to cite a source, I don't think a link is necessary (we're already summarizing the incompatibility) but if we want one:

Anyway, this looks good to me!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can start without links. I'll be on the lookout for issues on the matter, and if people asks, I will suggest the link. Is that reasonable?

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 25, 2026

Merging this PR will not alter performance

✅ 18 untouched benchmarks


Comparing chore/update-config-reference (9095b19) with main (0dd9d00)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (ddeb230) during the generation of this report, so 0dd9d00 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
@ematipico ematipico requested a review from sarah11918 February 25, 2026 16:52
Copy link
Member

@ArmandPhilippot ArmandPhilippot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@ematipico ematipico merged commit ed2b536 into main Feb 25, 2026
26 of 27 checks passed
@ematipico ematipico deleted the chore/update-config-reference branch February 25, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs pr pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants