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 files changed
+18
-2
No files matched your search
+9
-1
@@ -67,7 +67,15 @@ public class ServletHttpFacade implements HttpFacade {
|
||||
|
||||
@Override
|
||||
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
|
||||
|
||||
+9
-1
@@ -80,7 +80,15 @@ public class CatalinaHttpFacade implements HttpFacade {
|
||||
|
||||
@Override
|
||||
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
|
||||
|
||||
Reference in new issue
Block a user