Skip to content

Commit

Permalink
Use URLDecode.decode() that is compatible with pre Java 10 versions (
Browse files Browse the repository at this point in the history
…#1505)

Use URLDecode.decode() that is compatible with pre Java 10 versions
  • Loading branch information
arvindkrishnakumar-okta authored Jun 14, 2024
1 parent 1638cc1 commit ca83314
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URISyntaxException;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
Expand Down Expand Up @@ -129,8 +130,8 @@ private void processRequest(HttpRequest request, boolean tokenRequest) {

private String getUriWithoutQueryString(HttpRequest request) {
try {
return URLDecoder.decode(StringUtils.substringBefore(request.getUri().toString(), "?"), StandardCharsets.UTF_8);
} catch (URISyntaxException e) {
return URLDecoder.decode(StringUtils.substringBefore(request.getUri().toString(), "?"), StandardCharsets.UTF_8.name());
} catch (URISyntaxException | UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
}
Expand Down

0 comments on commit ca83314

Please sign in to comment.