[SECURITY-276] Better method name, add tests

This commit is contained in:
Daniel Beck committed 2016-04-27 13:51:10 +02:00
1 parent 2ed0c046df
commit e6efae7d0d
5 files changed
+20 -6

No files matched your search

+3 -3
View File
@@ -1471,10 +1471,10 @@ public class Util {
}
/**
* Return true iff the parameter denotes an absolute URI, or a scheme-relative URI.
* Return true iff the parameter does not denote an absolute URI and not a scheme-relative URI.
*/
public static boolean isAbsoluteOrSchemeRelativeUri(@Nonnull String uri) {
return isAbsoluteUri(uri) || uri.startsWith("//");
public static boolean isSafeToRedirectTo(@Nonnull String uri) {
return !isAbsoluteUri(uri) && !uri.startsWith("//");
}
/**