This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 9ec7f008c89c9bfe533ce77cde7781260c3d1204 Author: Mark Thomas <ma...@apache.org> AuthorDate: Thu Oct 17 17:39:35 2019 +0100 Simplify on the grounds all tokens of interest are case-insensitive --- .../apache/tomcat/util/http/parser/TokenList.java | 31 ++-------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/java/org/apache/tomcat/util/http/parser/TokenList.java b/java/org/apache/tomcat/util/http/parser/TokenList.java index 49e50a5..ca5e153 100644 --- a/java/org/apache/tomcat/util/http/parser/TokenList.java +++ b/java/org/apache/tomcat/util/http/parser/TokenList.java @@ -39,25 +39,6 @@ public class TokenList { * @throws IOException If an I/O error occurs reading the header */ public static void parseTokenList(Reader input, Collection<String> result) throws IOException { - parseTokenList(input, true, result); - } - - - /** - * Parses a header of the form 1#token. - * - * @param input The header to parse - * @param forceLowerCase Should parsed tokens be forced to lower case? This - * is intended for headers where the values are - * case-insensitive - * @param result The Collection (usually a list of a set) to which - * the parsed token should be added - * - * @throws IOException If an I/O error occurs reading the header - */ - public static void parseTokenList(Reader input, boolean forceLowerCase, Collection<String> result) - throws IOException { - do { String fieldName = HttpParser.readToken(input); if (fieldName == null) { @@ -74,18 +55,10 @@ public class TokenList { SkipResult skipResult = HttpParser.skipConstant(input, ","); if (skipResult == SkipResult.EOF) { // EOF - if (forceLowerCase) { - result.add(fieldName.toLowerCase(Locale.ENGLISH)); - } else { - result.add(fieldName); - } + result.add(fieldName.toLowerCase(Locale.ENGLISH)); break; } else if (skipResult == SkipResult.FOUND) { - if (forceLowerCase) { - result.add(fieldName.toLowerCase(Locale.ENGLISH)); - } else { - result.add(fieldName); - } + result.add(fieldName.toLowerCase(Locale.ENGLISH)); continue; } else { // Not a token - ignore it --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org