Fix Credentials Encoding
This commit is contained in:
@@ -5,7 +5,6 @@ import org.springframework.cloud.service.ServiceInfo;
|
||||
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 @@ public class CloudFoundryConnectorDB2ServiceTest extends AbstractUserProvidedSer
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 class DB2ServiceInfo extends RelationalServiceInfo {
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user