camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject camel git commit: CAMEL-10395: Removed old WARN log which is no longer in use
Date Tue, 18 Oct 2016 08:09:28 GMT
Repository: camel
Updated Branches:
  refs/heads/master 25877b6b7 -> 3d82a4c2e


CAMEL-10395: Removed old WARN log which is no longer in use


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3d82a4c2
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3d82a4c2
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3d82a4c2

Branch: refs/heads/master
Commit: 3d82a4c2e1a89b6f52c60cc18580c3fbd40b9a26
Parents: 25877b6
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Tue Oct 18 10:04:40 2016 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Tue Oct 18 10:08:39 2016 +0200

----------------------------------------------------------------------
 .../org/apache/camel/impl/DefaultComponent.java | 34 ++++++--------------
 .../org/apache/camel/util/URISupportTest.java   |  6 ++++
 2 files changed, 15 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/3d82a4c2/camel-core/src/main/java/org/apache/camel/impl/DefaultComponent.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultComponent.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultComponent.java
index dca1446..5b47429 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultComponent.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultComponent.java
@@ -56,16 +56,7 @@ public abstract class DefaultComponent extends ServiceSupport implements
Compone
 
     @Deprecated
     protected String preProcessUri(String uri) {
-        // Give components a chance to preprocess URIs and migrate to URI syntax that discourages
invalid URIs
-        // (see CAMEL-4425)
-        // check URI string to the unsafe URI characters
-        String encodedUri = UnsafeUriCharactersEncoder.encode(uri);
-        if (!encodedUri.equals(uri)) {
-            // uri supplied is not really valid
-            // we just don't want to log the password setting here
-            LOG.warn("Supplied URI '{}' contains unsafe characters, please check encoding",
URISupport.sanitizeUri(uri));
-        }
-        return encodedUri;
+        return UnsafeUriCharactersEncoder.encode(uri);
     }
 
     public Endpoint createEndpoint(String uri) throws Exception {
@@ -388,15 +379,12 @@ public abstract class DefaultComponent extends ServiceSupport implements
Compone
      * Resolves a reference list parameter in the registry and removes it from
      * the map.
      * 
-     * @param parameters
-     *            parameter map.
-     * @param key
-     *            parameter map key.
-     * @param elementType
-     *            result list element type.
+     * @param parameters parameter map.
+     * @param key parameter map key.
+     * @param elementType result list element type.
      * @return the list of referenced objects or an empty list if the parameter
      *         map doesn't contain the key.
-     * @throws IllegalArgumentException if any of the referenced objects was 
+     * @throws IllegalArgumentException if any of the referenced objects was
      *         not found in registry.
      * @see EndpointHelper#resolveReferenceListParameter(CamelContext, String, Class)
      */
@@ -408,14 +396,10 @@ public abstract class DefaultComponent extends ServiceSupport implements
Compone
      * Resolves a reference list parameter in the registry and removes it from
      * the map.
      * 
-     * @param parameters
-     *            parameter map.
-     * @param key
-     *            parameter map key.
-     * @param elementType
-     *            result list element type.
-     * @param defaultValue
-     *            default value to use if the parameter map doesn't
+     * @param parameters parameter map.
+     * @param key parameter map key.
+     * @param elementType result list element type.
+     * @param defaultValue default value to use if the parameter map doesn't
      *            contain the key.
      * @return the list of referenced objects or the default value.
      * @throws IllegalArgumentException if any of the referenced objects was 

http://git-wip-us.apache.org/repos/asf/camel/blob/3d82a4c2/camel-core/src/test/java/org/apache/camel/util/URISupportTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/util/URISupportTest.java b/camel-core/src/test/java/org/apache/camel/util/URISupportTest.java
index 1b8d5a4..ad13409 100644
--- a/camel-core/src/test/java/org/apache/camel/util/URISupportTest.java
+++ b/camel-core/src/test/java/org/apache/camel/util/URISupportTest.java
@@ -231,6 +231,12 @@ public class URISupportTest extends ContextTestSupport {
         assertEquals(path, URISupport.sanitizePath(path));
     }
 
+    public void testSanitizeUriWithRawPassword() {
+        String uri = "http://foo?username=me&password=RAW(me#@123)&foo=bar";
+        String expected = "http://foo?username=me&password=xxxxxx&foo=bar";
+        assertEquals(expected, URISupport.sanitizeUri(uri));
+    }
+
     public void testNormalizeEndpointUriWithUserInfoSpecialSign() throws Exception {
         String out1 = URISupport.normalizeUri("ftp://us%40r:t%st@localhost:21000/tmp3/camel?foo=us@r");
         assertEquals("ftp://us%40r:t%25st@localhost:21000/tmp3/camel?foo=us%40r", out1);


Mime
View raw message