You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "martin-g (via GitHub)" <gi...@apache.org> on 2026/01/05 08:40:49 UTC
Re: [PR] WICKET-7172: Extend CSP with support for script-src-attr, style-src-attr [wicket]
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))
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@wicket.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org