MCPcopy Index your code
hub / github.com/apache/tomcat / normalize

Method normalize

java/org/apache/tomcat/util/http/RequestUtil.java:47–49  ·  view source on GitHub ↗

Normalize a relative URI path. This method normalizes "/./", "/../", "//" and "\". If the input path is an attempt to 'escape the root' (e.g. /../input.txt) then null is returned to prevent attempts to 'escape the root'. URI paths containing null bytes will be rejected. @param path Relative

(String path)

Source from the content-addressed store, hash-verified

45 * @return The normalized path or {@code null} if the input path attempts to 'escape the root'.
46 */
47 public static String normalize(String path) {
48 return normalize(path, true);
49 }
50
51
52 /**

Callers 15

testNormalizeMethod · 0.95
invokeMethod · 0.95
getRequestDispatcherMethod · 0.95
getAbsolutePathMethod · 0.95
getRelativePathMethod · 0.95
validateMethod · 0.95
getLockKeyMethod · 0.95
normalizeMethod · 0.95
getPathFromHrefMethod · 0.95
copyResourceMethod · 0.95
isPathValidMethod · 0.95

Calls 5

endsWithMethod · 0.80
lengthMethod · 0.80
indexOfMethod · 0.45
replaceMethod · 0.45
startsWithMethod · 0.45

Tested by 1

testNormalizeMethod · 0.76