Merge pull request #12640 from engix-ltd/master
Encode username/password pair instead of decoding it.
This commit is contained in:
commit
75dc3d8432
@ -347,7 +347,7 @@ public class TbHttpClient {
|
|||||||
if (CredentialsType.BASIC == credentials.getType()) {
|
if (CredentialsType.BASIC == credentials.getType()) {
|
||||||
BasicCredentials basicCredentials = (BasicCredentials) credentials;
|
BasicCredentials basicCredentials = (BasicCredentials) credentials;
|
||||||
String authString = basicCredentials.getUsername() + ":" + basicCredentials.getPassword();
|
String authString = basicCredentials.getUsername() + ":" + basicCredentials.getPassword();
|
||||||
String encodedAuthString = new String(Base64.getDecoder().decode(authString.getBytes(StandardCharsets.UTF_8)));
|
String encodedAuthString = new String(Base64.getEncoder().encode(authString.getBytes(StandardCharsets.UTF_8)));
|
||||||
headers.add("Authorization", "Basic " + encodedAuthString);
|
headers.add("Authorization", "Basic " + encodedAuthString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user