Improved: Prevent recurring errors block due to generateTokenForNonAjax
(OFBIZ-)
After the VM demos crash yesterday, I had a look at the log of trunk demo and
found a lot of recurring errors block due to CsrfUtil::generateTokenForNonAjax.
It's not a big deal but it's annoying to have such useless errors cluttering the
logs
@@ -199,7 +199,9 @@ public final class CsrfUtil {
requestMap = findRequestMap(requestMapMap, pathOrRequestUri);
}
if (requestMap == null) {
- Debug.logError("Cannot find the corresponding request map for path: " + pathOrRequestUri, MODULE);
+ if (!"org.apache.ofbiz.security.NoCsrfDefenseStrategy".equals(getStrategy().toString())) {
+ Debug.logWarning("Cannot find the corresponding request map for path: " + pathOrRequestUri, MODULE);
+ }
}
String tokenValue = "";
if (requestMap != null && requestMap.securityCsrfToken) {
