Skip to content

Commit

Permalink
Improved: SeoContextFilter.java is not able to handle query strings
Browse files Browse the repository at this point in the history
(OFBIZ-11278)

Removes a trailing blank and uses empty to check request::getParameterMap result

Thanks: Mathieu to spot "empty to check request::getParameterMap result"
  • Loading branch information
JacquesLeRoux committed Nov 10, 2019
1 parent 09e583b commit 61ade2a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
String uri = httpRequest.getRequestURI();

Map<String, String[]> parameterMap =request.getParameterMap();
if (parameterMap != null) {
if (!parameterMap.isEmpty()) {
List<BasicNameValuePair> params = new ArrayList<BasicNameValuePair>();
request.getParameterMap().forEach((name, values) -> {
for(String value : values) {
params.add(new BasicNameValuePair(name, value));
}
});
String queryString = URLEncodedUtils.format(params, Charset.forName("UTF-8"));
uri = uri + "?" + queryString;
uri = uri + "?" + queryString;
}

boolean forwarded = forwardUri(httpResponse, uri);
Expand Down

0 comments on commit 61ade2a

Please sign in to comment.