Skip to content

Commit

Permalink
replace deprecated org.springframework.util.Base64Utils with Base64
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeeD committed Dec 18, 2024
1 parent 454249e commit 81d2d09
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package {{invokerPackage}}.auth;

import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.util.Base64;

import org.springframework.http.HttpHeaders;
import org.springframework.util.Base64Utils;
import org.springframework.util.MultiValueMap;

{{>generatedAnnotation}}
Expand Down Expand Up @@ -34,6 +34,6 @@ public class HttpBasicAuth implements Authentication {
return;
}
String str = (username == null ? "" : username) + ":" + (password == null ? "" : password);
headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64Utils.encodeToString(str.getBytes(StandardCharsets.UTF_8)));
headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8)));
}
}

0 comments on commit 81d2d09

Please # to comment.