Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
markt-asf committed Jan 22, 2025
1 parent 2b43c51 commit a414092
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions java/org/apache/tomcat/util/http/RequestUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,28 @@ private RequestUtil() {


/**
* Normalize a relative URI path that may have relative values ("/./", "/../", and so on ) it it.
* <strong>WARNING</strong> - This method is useful only for normalizing application-generated paths. It does not
* try to perform security checks for malicious input.
* 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 {@code null} is returned to prevent attempts to 'escape
* the root'. <strong>WARNING</strong> - No other URI validation checks are performed.
*
* @param path Relative path to be normalized
*
* @return The normalized path or <code>null</code> if the path cannot be normalized
* @return The normalized path or {@code null} if the input path attempts to 'escape the root'.
*/
public static String normalize(String path) {
return normalize(path, true);
}


/**
* Normalize a relative URI path that may have relative values ("/./", "/../", and so on ) it it.
* <strong>WARNING</strong> - This method is useful only for normalizing application-generated paths. It does not
* try to perform security checks for malicious input.
* Normalize a relative URI path. This method normalizes "/./", "/../" and "//". This method optionally normalizes
* "\". If the input path is an attempt to 'escape the root' (e.g. /../input.txt) then {@code null} is returned to
* prevent attempts to 'escape the root'. <strong>WARNING</strong> - No other URI validation checks are performed.
*
* @param path Relative path to be normalized
* @param replaceBackSlash Should '\\' be replaced with '/'
* @param replaceBackSlash Should '\\' be normalized to '/'
*
* @return The normalized path or <code>null</code> if the path cannot be normalized
* @return The normalized path or {@code null} if the input path attempts to 'escape the root'.
*/
public static String normalize(String path, boolean replaceBackSlash) {

Expand Down

0 comments on commit a414092

Please sign in to comment.