Skip to content

Commit

Permalink
Fix #231: remove url encoding for DB2
Browse files Browse the repository at this point in the history
* so that username and password are properly transmitted to the drive
* provide same behavior as Spring SAR/ SCS connector: spring-cloud/spring-cloud-connectors@a8eef2b
  • Loading branch information
anthonydahanne committed Oct 27, 2023
1 parent b9f10aa commit c332af4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public String buildJdbcUrlFromUriField(CfCredentials cfCredentials) {
UriInfo uriInfo = cfCredentials.getUriInfo(DB2_SCHEME);
return String.format("jdbc:%s://%s:%d/%s:user=%s;password=%s;",
DB2_SCHEME, uriInfo.getHost(), uriInfo.getPort(), uriInfo.getPath(),
UriInfo.urlEncode(uriInfo.getUsername()), UriInfo.urlEncode(uriInfo.getPassword()));
uriInfo.getUsername(), uriInfo.getPassword());
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,6 @@ protected String getExpectedJdbcUrl(String databaseType, String name) {

protected String getExpectedJdbcUrl(String scheme, String name, String uname, String pwd) {
return String.format("jdbc:%s://%s:%d/%s:user=%s;password=%s;",
DB2JdbcUrlCreator.DB2_SCHEME, hostname, port, name, UriInfo.urlEncode(uname), UriInfo.urlEncode(pwd));
DB2JdbcUrlCreator.DB2_SCHEME, hostname, port, name, uname, pwd);
}
}

0 comments on commit c332af4

Please sign in to comment.