You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/02/18 20:26:46 UTC

[camel] branch main updated: camel-core: tracer should escape and not unescape message body as json

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new aa2055ed018 camel-core: tracer should escape and not unescape message body as json
aa2055ed018 is described below

commit aa2055ed018097c0926fe21c4202f22920a1dd78
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Feb 18 21:26:05 2023 +0100

    camel-core: tracer should escape and not unescape message body as json
---
 .../src/main/java/org/apache/camel/support/MessageHelper.java         | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/camel-support/src/main/java/org/apache/camel/support/MessageHelper.java b/core/camel-support/src/main/java/org/apache/camel/support/MessageHelper.java
index 00aded1df90..d949abfee07 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/MessageHelper.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/MessageHelper.java
@@ -950,7 +950,7 @@ public final class MessageHelper {
 
             String data = extractBodyForLogging(message, null, allowCachedStreams, allowStreams, allowFiles, maxChars);
             if (data != null) {
-                jb.put("value", Jsoner.unescape(data));
+                jb.put("value", Jsoner.escape(data));
             }
         }
 
@@ -1029,7 +1029,7 @@ public final class MessageHelper {
         exception.printStackTrace(new PrintWriter(sw));
         String trace = sw.toString();
         try {
-            jo.put("stackTrace", Jsoner.unescape(trace));
+            jo.put("stackTrace", Jsoner.escape(trace));
         } catch (Throwable e) {
             // ignore as the body is for logging purpose
         }