summaryrefslogtreecommitdiffstats
path: root/utils/webseal-simulator/src/main
diff options
context:
space:
mode:
authorvasraz <vasyl.razinkov@est.tech>2022-04-13 12:50:49 +0100
committerVasyl Razinkov <vasyl.razinkov@est.tech>2022-04-19 09:42:25 +0000
commitbce397cccde46497c482a5118528e1044757be27 (patch)
treebeb4e6662bd1ed4a8ed35adcbe827b68fe82a400 /utils/webseal-simulator/src/main
parentfc2bd161cb694f426d0f02e8b322870177036f7f (diff)
Fix encoding/decoding issue
Change-Id: If7a770548702cb9e6bb2d9e866c99c0396f74ee4 Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Issue-ID: SDC-3967 (cherry picked from commit eb8de3664309f577362df7710d6cd93d00a734e2)
Diffstat (limited to 'utils/webseal-simulator/src/main')
-rw-r--r--utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/SdcProxy.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/SdcProxy.java b/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/SdcProxy.java
index 0637f7e29f..10a6bb8e74 100644
--- a/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/SdcProxy.java
+++ b/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/SdcProxy.java
@@ -20,10 +20,11 @@
package org.openecomp.sdc.webseal.simulator;
+import static java.nio.charset.StandardCharsets.UTF_8;
+
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
@@ -204,7 +205,7 @@ public class SdcProxy extends HttpServlet {
return contextPaths;
}
- private String getUri(HttpServletRequest request, Map<String, String[]> requestParameters) throws UnsupportedEncodingException {
+ private String getUri(HttpServletRequest request, Map<String, String[]> requestParameters) {
String suffix = request.getRequestURI();
if (getContextPaths().stream().anyMatch(request.getRequestURI()::contains)) {
suffix = alignUrlProxy(suffix);
@@ -316,7 +317,7 @@ public class SdcProxy extends HttpServlet {
return SDC1 + requestURI;
}
- private StringBuilder alignUrlParameters(Map<String, String[]> requestParameters) throws UnsupportedEncodingException {
+ private StringBuilder alignUrlParameters(Map<String, String[]> requestParameters) {
final var query = new StringBuilder();
for (final Entry<String, String[]> entry : requestParameters.entrySet()) {
for (final String value : entry.getValue()) {
@@ -325,7 +326,7 @@ public class SdcProxy extends HttpServlet {
} else {
query.append("&");
}
- query.append(String.format("&%s=%s", URLEncoder.encode(entry.getKey(), "UTF-8"), URLEncoder.encode(value, "UTF-8")));
+ query.append(String.format("&%s=%s", URLEncoder.encode(entry.getKey(), UTF_8), URLEncoder.encode(value, UTF_8)));
}
}
return query;