lukaszlenart commented on a change in pull request #462:
URL: https://github.com/apache/struts/pull/462#discussion_r553786793



##########
File path: 
core/src/main/java/org/apache/struts2/dispatcher/StaticContentLoader.java
##########
@@ -57,4 +67,32 @@
      */
     void findStaticResource(String path, HttpServletRequest request, 
HttpServletResponse response) throws IOException;
 
+    class Validator {
+
+        private static final Logger LOG = 
LogManager.getLogger(DefaultStaticContentLoader.class);
+
+        public static String validateStaticContentPath(String 
uiStaticContentPath) {
+            if (StringUtils.isBlank(uiStaticContentPath)) {
+                LOG.warn("\"{}\" has been set to \"{}\", falling back into 
default value \"{}\"",
+                    StrutsConstants.STRUTS_UI_STATIC_CONTENT_PATH,
+                    uiStaticContentPath,
+                    StaticContentLoader.DEFAULT_STATIC_CONTENT_PATH);
+                return StaticContentLoader.DEFAULT_STATIC_CONTENT_PATH;
+            } else if ("/".equals(uiStaticContentPath)) {
+                LOG.warn("\"{}\" cannot be set to \"{}\", falling back into 
default value \"{}\"",
+                    StrutsConstants.STRUTS_UI_STATIC_CONTENT_PATH,
+                    uiStaticContentPath,
+                    StaticContentLoader.DEFAULT_STATIC_CONTENT_PATH);
+                return StaticContentLoader.DEFAULT_STATIC_CONTENT_PATH;
+            } else if(!uiStaticContentPath.startsWith("/")) {

Review comment:
       fixed!




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


Reply via email to