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 2022/01/17 11:57:16 UTC
[camel] branch camel-3.14.x updated: CAMEL-17501: FailedToCreateRouteException should cut the route toString before sanitizing in case the uri is very long.
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-3.14.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.14.x by this push:
new 0da7b6a CAMEL-17501: FailedToCreateRouteException should cut the route toString before sanitizing in case the uri is very long.
0da7b6a is described below
commit 0da7b6aa3efd289393f46961e83c56153b871e27
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Jan 17 12:07:49 2022 +0100
CAMEL-17501: FailedToCreateRouteException should cut the route toString before sanitizing in case the uri is very long.
---
.../org/apache/camel/FailedToCreateRouteException.java | 15 +++++++--------
.../org/apache/camel/model/RouteDefinitionHelper.java | 16 +++++++---------
2 files changed, 14 insertions(+), 17 deletions(-)
diff --git a/core/camel-api/src/main/java/org/apache/camel/FailedToCreateRouteException.java b/core/camel-api/src/main/java/org/apache/camel/FailedToCreateRouteException.java
index 745b4c7..c0c7d8f 100644
--- a/core/camel-api/src/main/java/org/apache/camel/FailedToCreateRouteException.java
+++ b/core/camel-api/src/main/java/org/apache/camel/FailedToCreateRouteException.java
@@ -46,16 +46,15 @@ public class FailedToCreateRouteException extends RuntimeCamelException {
}
protected static String getRouteMessage(String route) {
- // ensure to sanitize uri's in the route so we do not show sensitive information such as passwords
- route = URISupport.sanitizeUri(route);
-
- // cut the route after 60 chars so it won't be too big in the message
- // users just need to be able to identify the route so they know where to look
+ // cut the route after 60 chars, so it won't be too big in the message
+ // users just need to be able to identify the route, so they know where to look
if (route.length() > 60) {
- return route.substring(0, 60) + "...";
- } else {
- return route;
+ route = route.substring(0, 60) + "...";
}
+
+ // ensure to sanitize uri's in the route, so we do not show sensitive information such as passwords
+ route = URISupport.sanitizeUri(route);
+ return route;
}
}
diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/RouteDefinitionHelper.java b/core/camel-core-model/src/main/java/org/apache/camel/model/RouteDefinitionHelper.java
index c61d997..1194d2c 100644
--- a/core/camel-core-model/src/main/java/org/apache/camel/model/RouteDefinitionHelper.java
+++ b/core/camel-core-model/src/main/java/org/apache/camel/model/RouteDefinitionHelper.java
@@ -745,16 +745,14 @@ public final class RouteDefinitionHelper {
}
public static String getRouteMessage(String route) {
- // ensure to sanitize uri's in the route so we do not show sensitive
- // information such as passwords
- route = URISupport.sanitizeUri(route);
- // cut the route after 60 chars so it won't be too big in the message
- // users just need to be able to identify the route so they know where
- // to look
+ // cut the route after 60 chars, so it won't be too big in the message
+ // users just need to be able to identify the route, so they know where to look
if (route.length() > 60) {
- return route.substring(0, 60) + "...";
- } else {
- return route;
+ route = route.substring(0, 60) + "...";
}
+
+ // ensure to sanitize uri's in the route, so we do not show sensitive information such as passwords
+ route = URISupport.sanitizeUri(route);
+ return route;
}
}