brusdev commented on code in PR #4362:
URL: https://github.com/apache/activemq-artemis/pull/4362#discussion_r1102924186


##########
artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/jolokia-access.xml:
##########
@@ -23,7 +23,7 @@ under the License.
 <restrict>
 
     <cors>
-        <!-- Allow cross origin access from ${http.host} ... -->
+        <!-- Allow cross origin access from ${http.host-for-comment} ... -->

Review Comment:
   ncluding in a comment a hostname that doesn't match the real hostname is 
confusing, what about just removing `${http.host}` from the comment?
   ```suggestion
           <!-- Allow cross origin access from the origins that match the 
following pattern -->
   ```
   I



##########
artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java:
##########
@@ -1115,6 +1116,26 @@ private void writeEtc(String source, File etcFolder, 
HashMap<String, String> fil
       write("etc/" + source, new File(etcFolder, source), filters, unixTarget, 
force);
    }
 
+   /**
+    * Format text so that it's safe to use as an XML comment.
+    *
+    * XML comments cannot contain certain elements.  This method will strip 
those elements out and return text that will be valid xml.
+    *
+    * XML comments cannot have "--" inside them, and they cannot end with "-"
+    * ref: https://www.w3.org/TR/2008/REC-xml-20081126/#sec-comments
+    *
+    * @param text The text to format
+    * @return text that is safe to put into an xml comment.
+    */
+   protected String safeForXmlComment(String text) {
+
+      String newText = text.replaceAll("---", "-").replaceAll("--", "-");

Review Comment:
   safeForXmlComment doesn't work with all texts i.e. 
`safeForXmlComment("-------")` should return `--`



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to