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_r302991438
 
 

 ##########
 File path: 
wicket-core/src/main/java/org/apache/wicket/core/util/string/JavaScriptUtils.java
 ##########
 @@ -227,10 +269,23 @@ public static void writeJavaScript(final Response 
response, final CharSequence t
         */
        public static void writeOpenTag(final Response response, String id)
        {
-               response.write("<script type=\"text/javascript\" ");
-               if (id != null)
-               {
-                       response.write("id=\"" + Strings.escapeMarkup(id) + 
"\"");
+               HeaderItemAttributeMap attributes = new 
HeaderItemAttributeMap();
+               attributes.add(HeaderItemAttribute.TYPE, "text/javascript");
+               if (id != null) {
+                       attributes.add(HeaderItemAttribute.ID, id);
+               }
+               writeOpenTag(response, attributes);
+       }
+
+       /**
+        * @param response
+        * @param attributes
+        */
+       public static void writeOpenTag(final Response response, IValueMap 
attributes)
+       {
+               response.write("<script ");
+               if (attributes != null) {
 
 Review comment:
   code style

----------------------------------------------------------------
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