diff --git a/web/src/main/java/org/springframework/security/web/util/UrlUtils.java b/web/src/main/java/org/springframework/security/web/util/UrlUtils.java index d4f891dc6a..65e9ede82b 100644 --- a/web/src/main/java/org/springframework/security/web/util/UrlUtils.java +++ b/web/src/main/java/org/springframework/security/web/util/UrlUtils.java @@ -76,14 +76,7 @@ public final class UrlUtils { public static String buildRequestUrl(String servletPath, String requestURI, String contextPath, String pathInfo, String queryString) { - String uri = servletPath; - - if (uri == null) { - uri = requestURI; - uri = uri.substring(contextPath.length()); - } - - return uri + ((pathInfo == null) ? "" : pathInfo) + ((queryString == null) ? "" : ("?" + queryString)); + return servletPath + ((pathInfo == null) ? "" : pathInfo) + ((queryString == null) ? "" : ("?" + queryString)); } /**