mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-21 15:55:40 +00:00
[SECURITY-276] Better method name, add tests
This commit is contained in:
1 parent
2ed0c046df
commit
e6efae7d0d
5 files changed
+20
-6
No files matched your search
@@ -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("//");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user