From 052543a964466493ce2652bc6dd48c8a8b1dad1d Mon Sep 17 00:00:00 2001 From: Arvind Krishnakumar Date: Fri, 14 Jun 2024 09:14:26 -0500 Subject: [PATCH] Use URLDecode.decode() that is compatible with pre Java 10 versions --- .../main/java/com/okta/sdk/impl/oauth2/DPoPInterceptor.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/impl/src/main/java/com/okta/sdk/impl/oauth2/DPoPInterceptor.java b/impl/src/main/java/com/okta/sdk/impl/oauth2/DPoPInterceptor.java index 4ce8e8dc263..c3bdda93247 100644 --- a/impl/src/main/java/com/okta/sdk/impl/oauth2/DPoPInterceptor.java +++ b/impl/src/main/java/com/okta/sdk/impl/oauth2/DPoPInterceptor.java @@ -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; @@ -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); } }