diff --git a/pom.xml b/pom.xml index 187caa6..8043da5 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.axonivy.connector.aws amazon-aws4-authenticator - 0.0.6-SNAPSHOT + 0.0.7-SNAPSHOT Amazon AWS 4 Authenticator 11 diff --git a/src/main/java/com/axonivy/connector/aws/authentication/CanonicalRequest.java b/src/main/java/com/axonivy/connector/aws/authentication/CanonicalRequest.java index c8c5c67..c01cc92 100644 --- a/src/main/java/com/axonivy/connector/aws/authentication/CanonicalRequest.java +++ b/src/main/java/com/axonivy/connector/aws/authentication/CanonicalRequest.java @@ -3,6 +3,7 @@ import static com.axonivy.connector.aws.authentication.Constants.SIGNED_HEADERS; import static com.axonivy.connector.aws.authentication.Constants.X_AMZ_DATE; +import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; @@ -42,16 +43,15 @@ private void appendPath() { path = "/"; } try { - System.out.println(path); var encodedPath = URLEncoder.encode(path, StandardCharsets.UTF_8.toString()) - .replace("%2F", "/") - .replace("%7E", "~") - .replace("*", "%2A") - .replace("+", "%20"); + .replace("%2F", "/") + .replace("%7E", "~") + .replace("*", "%2A") + .replace("+", "%20"); builder.append(encodedPath); builder.append('\n'); - } catch (Exception ex) { - throw new RuntimeException("Could not encode path " + path, ex); + } catch (UnsupportedEncodingException ex) { + throw new RuntimeException("Unable to encode path " + path, ex); } }