ChristopherSchultz commented on code in PR #681:
URL: https://github.com/apache/tomcat/pull/681#discussion_r1434510673


##########
java/org/apache/catalina/filters/CsrfPreventionFilter.java:
##########
@@ -198,15 +416,27 @@ protected boolean skipNonceCheck(HttpServletRequest 
request) {
 
         String requestedPath = getRequestedPath(request);
 
-        if (!entryPoints.contains(requestedPath)) {
-            return false;
+        if (entryPoints.contains(requestedPath)) {
+            if (log.isTraceEnabled()) {
+                log.trace("Skipping CSRF nonce-check for GET request to entry 
point " + requestedPath);
+            }
+
+            return true;
         }
 
-        if (log.isTraceEnabled()) {
-            log.trace("Skipping CSRF nonce-check for GET request to entry 
point " + requestedPath);
+        if (null != noNoncePredicates && !noNoncePredicates.isEmpty()) {
+            for (Predicate<String> p : noNoncePredicates) {
+                if (p.test(requestedPath)) {
+                    if (log.isTraceEnabled()) {
+                        log.trace("Skipping CSRF nonce-check for GET request 
to no-nonce path " + requestedPath);

Review Comment:
   > No `messages.properties`?
   
   This class does not currently use localized exception messages. I'm happy to 
do that work in a separate PR. I'm trying not to re-write every line of the 
source file, and I'm trying to keep things consistent.



-- 
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: dev-unsubscr...@tomcat.apache.org

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

Reply via email to