[GitHub] [tomcat] martin-g commented on a change in pull request #418: DefaultServlet - Strip BOM improvements.

2021-05-11 Thread GitBox


martin-g commented on a change in pull request #418:
URL: https://github.com/apache/tomcat/pull/418#discussion_r630108180



##
File path: java/org/apache/catalina/servlets/DefaultServlet.java
##
@@ -335,8 +344,15 @@ public void init() throws ServletException {
 }
 }
 
-if (getServletConfig().getInitParameter("useBomIfPresent") != null) {
-useBomIfPresent = 
Boolean.parseBoolean(getServletConfig().getInitParameter("useBomIfPresent"));
+final String useBomIfPresentConfig = 
getServletConfig().getInitParameter("useBomIfPresent");
+if (useBomIfPresentConfig != null) {
+if (!Arrays.asList("true", "false", 
"pass-through").contains(useBomIfPresentConfig)) {

Review comment:
   What do you suggest, @rmaucher ?!
   Should I avoid commenting the minor things until the PR is merged ?
   
   I have approved the PR - that means that overall it looks good to me!
   
   I am not sure about the API break (from `boolean` to `String`) but the 
public part of the Tomcat API is very blur to me so I leave this to more 
experienced Tomcat developers.




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



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat] martin-g commented on a change in pull request #418: DefaultServlet - Strip BOM improvements.

2021-05-11 Thread GitBox


martin-g commented on a change in pull request #418:
URL: https://github.com/apache/tomcat/pull/418#discussion_r630065973



##
File path: java/org/apache/catalina/servlets/DefaultServlet.java
##
@@ -335,8 +344,15 @@ public void init() throws ServletException {
 }
 }
 
-if (getServletConfig().getInitParameter("useBomIfPresent") != null) {
-useBomIfPresent = 
Boolean.parseBoolean(getServletConfig().getInitParameter("useBomIfPresent"));
+final String useBomIfPresentConfig = 
getServletConfig().getInitParameter("useBomIfPresent");
+if (useBomIfPresentConfig != null) {
+if (!Arrays.asList("true", "false", 
"pass-through").contains(useBomIfPresentConfig)) {

Review comment:
   The list could be extracted to a constant of type `Set`. 




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



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org