Commit e131ba9
committed
Add nonceStyleSrcElem() to complete nonce support on element directives
A nonce is valid on the four element directives (script-src, script-src-elem,
style-src, style-src-elem) per CSP3. Added the style-src-elem counterpart of
nonceScriptSrcElem(). No nonce helper for the -attr directives: a nonce matches
elements, not inline event handlers or style attributes, so it could never apply
there. No sha helpers for the granular directives - the generic add() attaches
precomputed hashes and the -attr hashes need 'unsafe-hashes' to apply.1 parent 938bf13 commit e131ba9
2 files changed
Lines changed: 21 additions & 0 deletions
File tree
- modules/web/web-api/src
- main/java/com/enonic/xp/web/csp
- test/java/com/enonic/xp/web/csp
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
| |||
641 | 643 | | |
642 | 644 | | |
643 | 645 | | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
644 | 656 | | |
645 | 657 | | |
646 | 658 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
843 | 843 | | |
844 | 844 | | |
845 | 845 | | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
846 | 855 | | |
847 | 856 | | |
848 | 857 | | |
| |||
0 commit comments