[Users | Trunk]: Remove encoding from create params

This commit is contained in:
Konstantinos Triantafyllou 2021-06-08 11:04:31 +00:00
parent 6665403c55
commit 6e1d2cb6b8
1 changed files with 2 additions and 6 deletions

View File

@ -11,6 +11,7 @@ import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
@ -86,12 +87,7 @@ public class HttpUtils {
int count = 0; int count = 0;
for (Map.Entry<String, String> param : params.entrySet()) { for (Map.Entry<String, String> param : params.entrySet()) {
ret.append(param.getKey()).append("="); ret.append(param.getKey()).append("=");
try { ret.append(param.getValue());
ret.append(URLEncoder.encode(param.getValue(), StandardCharsets.UTF_8.toString()));
} catch (UnsupportedEncodingException e) {
logger.error("UnsupportedEncodingException on param " + param);
return null;
}
count++; count++;
if (count != params.entrySet().size()) { if (count != params.entrySet().size()) {
ret.append("&"); ret.append("&");