Fix check for anonymous authentication
Same check as User.get(Authentication) uses, so this should work
@@ -7,6 +7,7 @@ package hudson.security.csrf;
import hudson.util.MultipartFormDataParser;
import jenkins.model.Jenkins;
+import org.acegisecurity.providers.anonymous.AnonymousAuthenticationToken;
import java.io.IOException;
import java.util.Enumeration;
@@ -70,7 +71,7 @@ public class CrumbFilter implements Filter {
}
// JENKINS-40344: Don't spam the log just because a session is expired
- Level level = Jenkins.getAuthentication() == Jenkins.ANONYMOUS ? Level.FINE : Level.WARNING;
+ Level level = Jenkins.getAuthentication() instanceof AnonymousAuthenticationToken ? Level.FINE : Level.WARNING;
if (crumb != null) {
if (crumbIssuer.validateCrumb(httpRequest, crumbSalt, crumb)) {
