solomax commented on a change in pull request #376: WICKET-6682 add CSP nonce 
support: initial commit
URL: https://github.com/apache/wicket/pull/376#discussion_r302991884
 
 

 ##########
 File path: 
wicket-core/src/main/java/org/apache/wicket/markup/head/filter/CspNonceHeaderResponse.java
 ##########
 @@ -0,0 +1,348 @@
+package org.apache.wicket.markup.head.filter;
+
+import org.apache.wicket.Application;
+import org.apache.wicket.core.request.handler.IPartialPageRequestHandler;
+import org.apache.wicket.core.util.string.CssUtils;
+import org.apache.wicket.core.util.string.JavaScriptUtils;
+import org.apache.wicket.markup.head.*;
+import org.apache.wicket.markup.html.DecoratingHeaderResponse;
+import org.apache.wicket.request.Response;
+import org.apache.wicket.request.cycle.RequestCycle;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.request.resource.ResourceReference;
+import org.apache.wicket.util.lang.Args;
+import org.apache.wicket.util.string.Strings;
+import org.apache.wicket.util.value.HeaderItemAttribute;
+import org.apache.wicket.util.value.HeaderItemAttributeMap;
+
+/**
+ * Add CSP nonce to all relevant JavaScript and CSS header items
+ * <p>
+ * Note: please don't forget to wrap with {@link ResourceAggregator}
+ *  when setting it up with {@link Application#setHeaderResponseDecorator},
+ *  otherwise dependencies will not be rendered
+ */
+public abstract class CspNonceHeaderResponse extends DecoratingHeaderResponse {
 
 Review comment:
   open brace should be on separate line

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to