MCPcopy Create free account
hub / github.com/apache/tomcat / isToken

Method isToken

java/org/apache/tomcat/util/http/parser/HttpParser.java:279–286  ·  view source on GitHub ↗

Checks if the given character is a valid HTTP token character as per RFC 7230. @param c the character to check @return true if the character is a valid token character

(int c)

Source from the content-addressed store, hash-verified

277 * @return {@code true} if the character is a valid token character
278 */
279 public static boolean isToken(int c) {
280 // Fast for correct values, slower for incorrect ones
281 try {
282 return IS_TOKEN[c];
283 } catch (ArrayIndexOutOfBoundsException ex) {
284 return false;
285 }
286 }
287
288
289 /**

Callers 15

testTokenDelMethod · 0.95
testTokenStringNullMethod · 0.95
testTokenStringEmptyMethod · 0.95
testTokenStringLws01Method · 0.95
testTokenStringLws02Method · 0.95
testTokenStringLws03Method · 0.95
testTokenStringValidMethod · 0.95
parametersMethod · 0.95
validateAttributeMethod · 0.95
readTokenMethod · 0.95
parseMethod · 0.95
parseHeaderMethod · 0.95

Calls 2

toCharArrayMethod · 0.80
isEmptyMethod · 0.45

Tested by 8

testTokenDelMethod · 0.76
testTokenStringNullMethod · 0.76
testTokenStringEmptyMethod · 0.76
testTokenStringLws01Method · 0.76
testTokenStringLws02Method · 0.76
testTokenStringLws03Method · 0.76
testTokenStringValidMethod · 0.76
parametersMethod · 0.76