1
0
mirror of synced 2026-08-04 01:07:02 +00:00

DefaultRedirectStrategy should redirect to root if the context-relative URL does not contain the context-path.

This commit is contained in:
Michel Palourdio
2016-11-26 13:08:34 +01:00
committed by Eleftheria Stein-Kousathana
parent 1c53a7859b
commit d26f40f062
2 changed files with 19 additions and 0 deletions
@@ -73,6 +73,10 @@ public class DefaultRedirectStrategy implements RedirectStrategy {
return url;
}
if (!url.contains(contextPath)) {
return "";
}
// Calculate the relative URL from the fully qualified URL, minus the last
// occurrence of the scheme and base context.
url = url.substring(url.lastIndexOf("://") + 3); // strip off scheme