Skip to content

Commit

Permalink
Use URLEncoder#encode(String, String)
Browse files Browse the repository at this point in the history
as URLEncoder#encode(String, Charset) is only available since Java
10
  • Loading branch information
jkakavas committed Jul 2, 2019
1 parent 4ea17b7 commit c8ed271
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,8 @@ private void exchangeCodeForToken(AuthorizationCode code, ActionListener<Tuple<A
httpPost.setEntity(new UrlEncodedFormEntity(params));
httpPost.setHeader("Content-type", "application/x-www-form-urlencoded");
UsernamePasswordCredentials creds =
new UsernamePasswordCredentials(URLEncoder.encode(rpConfig.getClientId().getValue(), StandardCharsets.UTF_8),
URLEncoder.encode(rpConfig.getClientSecret().toString(), StandardCharsets.UTF_8));
new UsernamePasswordCredentials(URLEncoder.encode(rpConfig.getClientId().getValue(), StandardCharsets.UTF_8.name()),
URLEncoder.encode(rpConfig.getClientSecret().toString(), StandardCharsets.UTF_8.name()));
httpPost.addHeader(new BasicScheme().authenticate(creds, httpPost, null));
SpecialPermission.check();
AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
Expand Down

0 comments on commit c8ed271

Please sign in to comment.