Skip to content

Commit 739cfc3

Browse files
author
Chris Wiechmann
committed
Update OpenAPIValidator.java
1 parent d4550ff commit 739cfc3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/main/java/com/axway/apim/openapi/validator/OpenAPIValidator.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.axway.apim.openapi.validator;
22

3+
import java.io.UnsupportedEncodingException;
34
import java.net.URI;
45
import java.net.URLDecoder;
56
import java.nio.charset.StandardCharsets;
@@ -224,7 +225,14 @@ public Collection<String> getQueryParameterValues(String name) {
224225
if(queryParams==null) return Collections.emptyList();
225226
ArrayList<String> values = queryParams.getHeaderValues(name);
226227
if(decodeQueryParams) {
227-
values.replaceAll(headerValue -> URLDecoder.decode(headerValue, StandardCharsets.UTF_8));
228+
values.replaceAll(headerValue -> {
229+
try {
230+
return URLDecoder.decode(headerValue, StandardCharsets.UTF_8.toString());
231+
} catch (UnsupportedEncodingException e) {
232+
Utils.traceMessage("Error decoding headerValue: " + headerValue + ". Error: " + e.getMessage(), TraceLevel.ERROR);
233+
return headerValue;
234+
}
235+
});
228236
}
229237
return (Collection<String>) ((values == null) ? Collections.emptyList() : values);
230238
}

0 commit comments

Comments
 (0)