This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit cf7196b09d687c4ceb1c52830b405e1c60197181 Author: Mark Thomas <ma...@apache.org> AuthorDate: Fri Mar 13 12:01:17 2020 +0000 Remove deprecated code --- .../apache/catalina/connector/CoyoteAdapter.java | 68 ---------------------- 1 file changed, 68 deletions(-) diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java b/java/org/apache/catalina/connector/CoyoteAdapter.java index 2862eb2..1d21a24 100644 --- a/java/org/apache/catalina/connector/CoyoteAdapter.java +++ b/java/org/apache/catalina/connector/CoyoteAdapter.java @@ -1238,74 +1238,6 @@ public class CoyoteAdapter implements Adapter { /** - * Check that the URI is normalized following character decoding. This - * method checks for "\", 0, "//", "/./" and "/../". - * - * @param uriMB URI to be checked (should be chars) - * - * @return <code>false</code> if sequences that are supposed to be - * normalized are still present in the URI, otherwise - * <code>true</code> - * - * @deprecated This code will be removed in Apache Tomcat 10 onwards - */ - @Deprecated - public static boolean checkNormalize(MessageBytes uriMB) { - - CharChunk uriCC = uriMB.getCharChunk(); - char[] c = uriCC.getChars(); - int start = uriCC.getStart(); - int end = uriCC.getEnd(); - - int pos = 0; - - // Check for '\' and 0 - for (pos = start; pos < end; pos++) { - if (c[pos] == '\\') { - return false; - } - if (c[pos] == 0) { - return false; - } - } - - // Check for "//" - for (pos = start; pos < (end - 1); pos++) { - if (c[pos] == '/') { - if (c[pos + 1] == '/') { - return false; - } - } - } - - // Check for ending with "/." or "/.." - if (((end - start) >= 2) && (c[end - 1] == '.')) { - if ((c[end - 2] == '/') - || ((c[end - 2] == '.') - && (c[end - 3] == '/'))) { - return false; - } - } - - // Check for "/./" - if (uriCC.indexOf("/./", 0, 3, 0) >= 0) { - return false; - } - - // Check for "/../" - if (uriCC.indexOf("/../", 0, 4, 0) >= 0) { - return false; - } - - return true; - - } - - - // ------------------------------------------------------ Protected Methods - - - /** * Copy an array of bytes to a different position. Used during * normalization. * --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org