Commit f26f286
committed
minor symfony#20362 [AssetMapper] Document usage of
This PR was merged into the 6.4 branch.
Discussion
----------
[AssetMapper] Document usage of `strict-dynamic` in a CSP
AssetMapper will include special importmap entries for CSS files, which get resolved to `data:application/javascript`.
See https://symfony.com/doc/current/frontend/asset_mapper.html#handling-css.
Browsers will report those as CSP violations, as `data:` scripts can also be used for XSS attacks. For the same reason, allowing `data:` in the CSP is not a safe solution.
symfony/symfony#58416 (comment) provides a solution: using `strict-dynamic` in the `script-src` directive will allow the importmap to include other resources.
This PR adds that solution to the documentation.
Commits
-------
358ece7 [AssetMapper] Document usage of `strict-dynamic` in a CSPstrict-dynamic in a CSP (nicwortel)1 file changed
+21
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
| 405 | + | |
| 406 | + | |
405 | 407 | | |
406 | 408 | | |
407 | 409 | | |
| |||
1103 | 1105 | | |
1104 | 1106 | | |
1105 | 1107 | | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
1106 | 1126 | | |
1107 | 1127 | | |
1108 | 1128 | | |
| |||
1186 | 1206 | | |
1187 | 1207 | | |
1188 | 1208 | | |
| 1209 | + | |
1189 | 1210 | | |
1190 | 1211 | | |
0 commit comments