[
https://issues.apache.org/jira/browse/WICKET-7172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18049096#comment-18049096
]
ASF GitHub Bot commented on WICKET-7172:
----------------------------------------
martin-g commented on code in PR #1341:
URL: https://github.com/apache/wicket/pull/1341#discussion_r2660689789
##########
wicket-core/src/main/java/org/apache/wicket/csp/CSPDirective.java:
##########
@@ -147,6 +151,19 @@ public String getValue()
public void checkValueForDirective(CSPRenderable value,
List<CSPRenderable> existingDirectiveValues)
{
+ if (this == SCRIPT_SRC_ATTR || this == STYLE_SRC_ATTR)
+ {
+ if (!existingDirectiveValues.isEmpty())
+ {
+ throw new IllegalArgumentException("Directive "
+ this + " supports only one value");
+ }
+
+ if (value != CSPDirectiveSrcValue.NONE && value !=
CSPDirectiveSrcValue.UNSAFE_INLINE)
Review Comment:
```suggestion
if (!CSPDirectiveSrcValue.NONE.equals(value) &&
!CSPDirectiveSrcValue.UNSAFE_INLINE.equals(value))
```
> Support new CSP style, script directives
> ----------------------------------------
>
> Key: WICKET-7172
> URL: https://issues.apache.org/jira/browse/WICKET-7172
> Project: Wicket
> Issue Type: Improvement
> Components: wicket-core
> Reporter: Kees van Dieren
> Priority: Major
>
> Support new CSP directives added to the CSP in 2022
> They where not yet supported by Wicket.
> See: https://github.com/apache/wicket/pull/1341
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)