michael-o commented on code in PR #681:
URL: https://github.com/apache/tomcat/pull/681#discussion_r1434512783
##########
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:
Agreed.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]