Skip to content
Permalink
Browse files

Improved: SeoContextFilter.java is not able to handle query strings

(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 61ade2add5af585ec873280da8051bdb1f139c71
@@ -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);

0 comments on commit 61ade2a

Please sign in to comment.
You can’t perform that action at this time.