Correctly decode URL coming into the Jolokia endpoint

fixes #869
pull/890/head
Christian Dupuis 11 years ago
parent e695e5d637
commit 875e77d420

@ -36,6 +36,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.context.ServletContextAware;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.ServletWrappingController;
import org.springframework.web.util.UrlPathHelper;
/**
* {@link MvcEndpoint} to expose Jolokia.
@ -124,15 +125,18 @@ public class JolokiaMvcEndpoint implements MvcEndpoint, InitializingBean,
private static class PathStripper extends HttpServletRequestWrapper {
private final String path;
private final UrlPathHelper urlPathHelper;
public PathStripper(HttpServletRequest request, String path) {
super(request);
this.path = path;
this.urlPathHelper = new UrlPathHelper();
}
@Override
public String getPathInfo() {
String value = super.getRequestURI();
String value = this.urlPathHelper.decodeRequestString(
(HttpServletRequest) getRequest(), super.getRequestURI());
if (value.contains(this.path)) {
value = value.substring(value.indexOf(this.path) + this.path.length());
}
@ -145,6 +149,6 @@ public class JolokiaMvcEndpoint implements MvcEndpoint, InitializingBean,
}
return value;
}
}
}

Loading…
Cancel
Save