Merge pull request #12640 from engix-ltd/master

Encode username/password pair instead of decoding it.
This commit is contained in:
Viacheslav Klimov 2025-02-10 15:54:23 +02:00 committed by GitHub
commit 75dc3d8432
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -347,7 +347,7 @@ public class TbHttpClient {
if (CredentialsType.BASIC == credentials.getType()) {
BasicCredentials basicCredentials = (BasicCredentials) credentials;
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);
}
}