Skip to content

Commit

Permalink
Refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
josegar74 committed Oct 26, 2023
1 parent 8f43ccb commit 7b67e82
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -471,13 +470,10 @@ private void internalService(HttpServletRequest servletRequest, HttpServletRespo
} catch (URISyntaxException e) {
throw new ServletException("Unexpected URI parsing error on " + queryString, e);
}
Map<String, List<String>> params = new HashMap<>();

LinkedHashMap<String, List<String>> 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
Expand Down

0 comments on commit 7b67e82

Please sign in to comment.