diff --git a/web/src/main/java/org/fao/geonet/proxy/URITemplateProxyServlet.java b/web/src/main/java/org/fao/geonet/proxy/URITemplateProxyServlet.java index 85eb56fe3e3..d932b2bbf80 100644 --- a/web/src/main/java/org/fao/geonet/proxy/URITemplateProxyServlet.java +++ b/web/src/main/java/org/fao/geonet/proxy/URITemplateProxyServlet.java @@ -50,7 +50,6 @@ import org.fao.geonet.repository.MetadataLinkRepository; import org.fao.geonet.repository.specification.LinkSpecs; import org.fao.geonet.utils.Log; -import org.mitre.dsmiley.httpproxy.ProxyServlet; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.SystemEnvironmentPropertySource; import org.springframework.http.HttpHeaders; @@ -471,13 +470,10 @@ private void internalService(HttpServletRequest servletRequest, HttpServletRespo } catch (URISyntaxException e) { throw new ServletException("Unexpected URI parsing error on " + queryString, e); } - Map> params = new HashMap<>(); + + LinkedHashMap> params = new LinkedHashMap<>(); for (NameValuePair pair : pairs) { - if (params.get(pair.getName()) != null) { - params.get(pair.getName()).add(pair.getValue()); - } else { - params.put(pair.getName(), new ArrayList<>(Arrays.asList(pair.getValue()))); - } + params.computeIfAbsent(pair.getName(), k -> new ArrayList<>()).add(pair.getValue()); } //Now rewrite the URL