Commit a2569d1c authored by Ard Schrijvers's avatar Ard Schrijvers

HSTTWO-4166 Make sure the PathInfo is computed correctly in the channel mgr

When the site runs in channel mgr, it can have the _cmsinternal path info
element. We need to account for this
parent 925026d4
......@@ -169,7 +169,13 @@ public class CXFJaxrsService extends AbstractJaxrsService {
protected String getJaxrsPathInfo(HstRequestContext requestContext, HttpServletRequest request) throws ContainerException {
String requestURI = request.getRequestURI();
HstContainerURL baseURL = requestContext.getBaseURL();
String pathInfo = StringUtils.substringAfter(requestURI, baseURL.getContextPath() + baseURL.getResolvedMountPath());
String pathInfo;
final String matchingIgnoredPrefix = requestContext.getResolvedMount().getMatchingIgnoredPrefix();
if (StringUtils.isNotBlank(matchingIgnoredPrefix)) {
pathInfo = StringUtils.substringAfter(requestURI, baseURL.getContextPath() + "/" + matchingIgnoredPrefix + baseURL.getResolvedMountPath());
} else {
pathInfo = StringUtils.substringAfter(requestURI, baseURL.getContextPath() + baseURL.getResolvedMountPath());
}
if (StringUtils.startsWith(pathInfo, ";")) {
pathInfo = "/" + StringUtils.substringAfter(pathInfo, "/");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment