Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[AssetMapper] Adding CSP details, recommendingscript-src 'strict-dynamic'#21356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
ThomasLandauer wants to merge1 commit intosymfony:6.4
base:6.4
Choose a base branch
Loading
fromThomasLandauer:patch-12

Conversation

ThomasLandauer
Copy link
Contributor

@ThomasLandauerThomasLandauer commentedSep 8, 2025
edited
Loading

Page:https://symfony.com/doc/6.4/frontend/asset_mapper.html#handling-css

I think there should be a clear recommendation for people using a Content-Security-Policy. Isscript-src 'strict-dynamic' really the way to go? It's not possible for AssetMapper to just omit those empty CSS entries, is it? Or change them to"/assets/app.css": ""?

(The info is taken fromsymfony/symfony#58416 (comment))

…ynamic'`Page:https://symfony.com/doc/6.4/frontend/asset_mapper.html#handling-cssI think there should be a clear recommendation for people using a Content-Security-Policy.Is `script-src 'strict-dynamic'` really the way to go? It's not possible for AssetMapper to just omit those empty entries, is it?
Copy link

@CopilotCopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds important Content-Security-Policy (CSP) documentation to the AssetMapper section, specifically addressing issues that occur when usingscript-src 'self' with CSS imports. The change clarifies how AssetMapper handles CSS imports through empty importmap entries and provides guidance for CSP configuration.

  • Explains how AssetMapper creates empty importmap entries for CSS files usingdata: URLs
  • Documents the CSP conflict that occurs withscript-src 'self' when importing CSS files
  • Recommends usingscript-src 'strict-dynamic' as a solution to CSP issues

Tip: Customize your code reviews with copilot-instructions.md.Create the file orlearn how to get started.

executes the ``import`` statement, nothing additional happens.
When using a **Content-Security-Policy** with ``script-src 'self'``, this
will trigger an error because of the ``data:`` URL. You can either just
ignore the error, or lower the rule to ``script-src 'strict-dynamic'``.
Copy link

CopilotAISep 9, 2025

Choose a reason for hiding this comment

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

[nitpick] The phrase 'lower the rule' is unclear and potentially confusing. Using 'strict-dynamic' is not necessarily 'lowering' security - it's a different security model. Consider rephrasing to 'change the rule to' or 'use' instead of 'lower the rule to'.

Suggested change
ignore the error, orlower the rule to ``script-src 'strict-dynamic'``.
ignore the error, orchange the rule to ``script-src 'strict-dynamic'``.

Copilot uses AI. Check for mistakes.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

Assignees
No one assigned
Projects
None yet
Milestone
6.4
Development

Successfully merging this pull request may close these issues.

2 participants
@ThomasLandauer@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp