yasserzamani commented on a change in pull request #428:
URL: https://github.com/apache/struts/pull/428#discussion_r462023263



##########
File path: 
core/src/main/java/org/apache/struts2/interceptor/FetchMetadataInterceptor.java
##########
@@ -41,17 +42,19 @@
  * filter the requests allowed to be processed.
  *
  * @see <a 
href="https://web.dev/fetch-metadata/";>https://web.dev/fetch-metadata/</a>
+ * @see <a 
href="https://www.w3.org/TR/fetch-metadata/";>https://www.w3.org/TR/fetch-metadata/</a>
  **/
 
 public class FetchMetadataInterceptor extends AbstractInterceptor {
-    private static final Logger logger = 
LogManager.getLogger(FetchMetadataInterceptor.class);
-    private static final String VARY_HEADER_VALUE = String.format("%s,%s,%s", 
SEC_FETCH_DEST_HEADER, SEC_FETCH_SITE_HEADER, SEC_FETCH_MODE_HEADER);
+    private static final Logger LOG = 
LogManager.getLogger(FetchMetadataInterceptor.class);
+    private static final String VARY_HEADER_VALUE = 
String.format("%s,%s,%s,%s", SEC_FETCH_DEST_HEADER, SEC_FETCH_MODE_HEADER, 
SEC_FETCH_SITE_HEADER, SEC_FETCH_USER_HEADER);
     private static final String SC_FORBIDDEN = 
String.valueOf(HttpServletResponse.SC_FORBIDDEN);
 
     private final Set<String> exemptedPaths = new HashSet<>();
     private final ResourceIsolationPolicy resourceIsolationPolicy = new 
StrutsResourceIsolationPolicy();
 
-    public void setExemptedPaths(String paths){
+    @Inject (required=false)

Review comment:
       will be nice to have a test for injection

##########
File path: 
core/src/main/java/org/apache/struts2/interceptor/FetchMetadataInterceptor.java
##########
@@ -73,15 +76,31 @@ public String intercept(ActionInvocation invocation) throws 
Exception {
             return invocation.invoke();
         }
 
-        logger.atDebug().log(
-            "Fetch metadata rejected cross-origin request to %s",
-            contextPath
-        );
+        LOG.debug("Fetch metadata rejected cross-origin request to [{}]", 
contextPath);

Review comment:
       To improve, I think `.warn` is better.




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