Skip to content

Commit

Permalink
fix #9910, metadata-report support a separate configuration username …
Browse files Browse the repository at this point in the history
…and password (#9921)
  • Loading branch information
zhaoguhong committed Jun 14, 2022
1 parent edd3d28 commit 8d9e252
Showing 1 changed file with 7 additions and 3 deletions.
Expand Up @@ -123,9 +123,13 @@ public URL toUrl() throws IllegalArgumentException {
map.putAll(convert(map, null));
// put the protocol of URL as the "metadata"
map.put("metadata", url.getProtocol());
return new URL("metadata", url.getUsername(), url.getPassword(), url.getHost(),
url.getPort(), url.getPath(), map);

return new URL("metadata",
StringUtils.isBlank(url.getUsername()) ? this.getUsername() : url.getUsername(),
StringUtils.isBlank(url.getPassword()) ? this.getPassword() : url.getPassword(),
url.getHost(),
// address port is priority
this.getPort() == null ? url.getPort() : url.getPort(this.getPort()),
url.getPath(), map);
}

public String getProtocol() {
Expand Down

0 comments on commit 8d9e252

Please sign in to comment.