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