Merge pull request #3853 from pedroigor/RHSSO-767
[RHSSO-767] - Wrong implementation of Request.getRelativePath causing failures on Tomcat-like adapters
This commit is contained in:
commit
e3a8bed5b2
2 changed files with 18 additions and 2 deletions
|
@ -67,7 +67,15 @@ public class ServletHttpFacade implements HttpFacade {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRelativePath() {
|
public String getRelativePath() {
|
||||||
return request.getServletPath();
|
String uri = request.getRequestURI();
|
||||||
|
String contextPath = request.getContextPath();
|
||||||
|
String servletPath = uri.substring(uri.indexOf(contextPath) + contextPath.length());
|
||||||
|
|
||||||
|
if ("".equals(servletPath)) {
|
||||||
|
servletPath = "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
return servletPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -80,7 +80,15 @@ public class CatalinaHttpFacade implements HttpFacade {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRelativePath() {
|
public String getRelativePath() {
|
||||||
return request.getServletPath();
|
String uri = request.getRequestURI();
|
||||||
|
String contextPath = request.getContextPath();
|
||||||
|
String servletPath = uri.substring(uri.indexOf(contextPath) + contextPath.length());
|
||||||
|
|
||||||
|
if ("".equals(servletPath)) {
|
||||||
|
servletPath = "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
return servletPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue