From a8eef2bdcbb5f177791d3843e2502db4c4dc32d8 Mon Sep 17 00:00:00 2001 From: pidoubleyou Date: Fri, 14 Dec 2018 23:13:37 +0100 Subject: [PATCH] Fix Credentials Encoding --- .../cloudfoundry/CloudFoundryConnectorDB2ServiceTest.java | 5 ++--- .../springframework/cloud/service/common/DB2ServiceInfo.java | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/spring-cloud-cloudfoundry-connector/src/test/java/org/springframework/cloud/cloudfoundry/CloudFoundryConnectorDB2ServiceTest.java b/spring-cloud-cloudfoundry-connector/src/test/java/org/springframework/cloud/cloudfoundry/CloudFoundryConnectorDB2ServiceTest.java index dcd76f30..0bb716a7 100644 --- a/spring-cloud-cloudfoundry-connector/src/test/java/org/springframework/cloud/cloudfoundry/CloudFoundryConnectorDB2ServiceTest.java +++ b/spring-cloud-cloudfoundry-connector/src/test/java/org/springframework/cloud/cloudfoundry/CloudFoundryConnectorDB2ServiceTest.java @@ -5,7 +5,6 @@ import org.springframework.cloud.service.common.DB2ServiceInfo; import org.springframework.cloud.service.common.MysqlServiceInfo; import org.springframework.cloud.service.common.RelationalServiceInfo; -import org.springframework.cloud.util.UriInfo; import java.util.List; @@ -85,11 +84,11 @@ protected String getDB2ServicePayloadWithJdbcurl(String serviceName, String host protected String getJdbcUrl(String scheme, String name) { return String.format("%s%s://%s:%d/%s:user=%s;password=%s;", JDBC_PREFIX, scheme, hostname, port, name, - UriInfo.urlEncode(username), UriInfo.urlEncode(password)); + username, password); } private String getJdbcUrl(String scheme, String hostname, int port, String name, String user, String password) { return String.format("%s%s://%s:%d/%s:user=%s;password=%s;", JDBC_PREFIX, scheme, hostname, port, name, - UriInfo.urlEncode(user), UriInfo.urlEncode(password)); + user, password); } } diff --git a/spring-cloud-core/src/main/java/org/springframework/cloud/service/common/DB2ServiceInfo.java b/spring-cloud-core/src/main/java/org/springframework/cloud/service/common/DB2ServiceInfo.java index d102c66c..d91a6ebd 100644 --- a/spring-cloud-core/src/main/java/org/springframework/cloud/service/common/DB2ServiceInfo.java +++ b/spring-cloud-core/src/main/java/org/springframework/cloud/service/common/DB2ServiceInfo.java @@ -1,7 +1,6 @@ package org.springframework.cloud.service.common; import org.springframework.cloud.service.ServiceInfo; -import org.springframework.cloud.util.UriInfo; @ServiceInfo.ServiceLabel("db2") public class DB2ServiceInfo extends RelationalServiceInfo { @@ -19,6 +18,6 @@ public DB2ServiceInfo(String id, String url, String jdbcUrl) { protected String buildJdbcUrl() { return String.format("jdbc:%s://%s:%d/%s:user=%s;password=%s;", jdbcUrlDatabaseType, - getHost(), getPort(), getPath(), UriInfo.urlEncode(getUserName()), UriInfo.urlEncode(getPassword())); + getHost(), getPort(), getPath(), getUserName(), getPassword()); } }