public class UrlUtil extends Object
Modifier and Type | Field and Description |
---|---|
protected static String |
VALID_SCHEME_CHARS |
Constructor and Description |
---|
UrlUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
fixRedirectUrl(String contextPath,
String url)
If the url does not include "//" then the system will ensure that the
application context is added to the start of the URL.
|
static String |
generateUrlKey(String toConvert) |
static boolean |
isAbsoluteUrl(String url)
Returns true if our current URL is absolute,
false otherwise.
|
static void |
validateUrl(String url,
javax.servlet.http.HttpServletRequest request)
Returns validated URL.
|
protected static final String VALID_SCHEME_CHARS
public static String fixRedirectUrl(String contextPath, String url)
url
- public static void validateUrl(String url, javax.servlet.http.HttpServletRequest request) throws IOException
url
- request
- IOException
org.owasp.esapi.Validator#isValidRedirectLocation(String, String, boolean),
which only works on relative URLs.
Throws an IOExcption if isValidRedirectLocation is false.
public static boolean isAbsoluteUrl(String url)
url
- the url to check outCopyright © 2022. All rights reserved.