Encode username/passwrod pair instead of decoding it while creating request.
(cherry picked from commit 0cda72e6b2847c1baee498d2971bb3431b1d1895)
This commit is contained in:
parent
3cb140a76a
commit
4cd5e0369d
@ -343,7 +343,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