This is an automated email from the ASF dual-hosted git repository.
papegaaij pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/wicket.git
The following commit(s) were added to refs/heads/master by this push:
new 0acc6aa WICKET-6849: Fix CSP for styling in quickstart
0acc6aa is described below
commit 0acc6aa692d3993548db0daac61212b80b931b9b
Author: Emond Papegaaij <[email protected]>
AuthorDate: Fri Oct 30 12:11:01 2020 +0100
WICKET-6849: Fix CSP for styling in quickstart
---
.../archetype-resources/src/main/java/WicketApplication.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git
a/archetypes/quickstart/src/main/resources/archetype-resources/src/main/java/WicketApplication.java
b/archetypes/quickstart/src/main/resources/archetype-resources/src/main/java/WicketApplication.java
index 9979761..a77f034 100644
---
a/archetypes/quickstart/src/main/resources/archetype-resources/src/main/java/WicketApplication.java
+++
b/archetypes/quickstart/src/main/resources/archetype-resources/src/main/java/WicketApplication.java
@@ -1,5 +1,7 @@
package ${package};
+import org.apache.wicket.csp.CSPDirective;
+import org.apache.wicket.csp.CSPDirectiveSrcValue;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.protocol.http.WebApplication;
@@ -28,6 +30,12 @@ public class WicketApplication extends WebApplication
{
super.init();
+ // needed for the styling used by the quickstart
+ getCspSettings().blocking()
+ .add(CSPDirective.STYLE_SRC, CSPDirectiveSrcValue.SELF)
+ .add(CSPDirective.STYLE_SRC,
"https://fonts.googleapis.com/css")
+ .add(CSPDirective.FONT_SRC,
"https://fonts.gstatic.com");
+
// add your configuration here
}
}