[ofbiz-framework] branch trunk updated: Improved: Prevent recurring errors block due to generateTokenForNonAjax

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch trunk updated: Improved: Prevent recurring errors block due to generateTokenForNonAjax

jleroux@apache.org
This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 1ff79ec  Improved: Prevent recurring errors block due to generateTokenForNonAjax
1ff79ec is described below

commit 1ff79ec56627cc06660d8f24118c221924bfd4fd
Author: Jacques Le Roux <[hidden email]>
AuthorDate: Sun Apr 26 12:38:05 2020 +0200

    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
---
 .../security/src/main/java/org/apache/ofbiz/security/CsrfUtil.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/framework/security/src/main/java/org/apache/ofbiz/security/CsrfUtil.java b/framework/security/src/main/java/org/apache/ofbiz/security/CsrfUtil.java
index 5309ac2..d5b0a22 100644
--- a/framework/security/src/main/java/org/apache/ofbiz/security/CsrfUtil.java
+++ b/framework/security/src/main/java/org/apache/ofbiz/security/CsrfUtil.java
@@ -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) {