Minor verbiage change in exception messages

This commit is contained in:
Joakim Erdfelt 2017-03-16 11:52:48 -07:00
parent ccf72d6752
commit 398e5b3462
1 changed files with 7 additions and 7 deletions

View File

@ -68,16 +68,16 @@ public final class Syntax
// 0x00 - 0x1F are low order control characters // 0x00 - 0x1F are low order control characters
// 0x7F is the DEL control character // 0x7F is the DEL control character
if ((c <= 0x1F) || (c == 0x7F)) if ((c <= 0x1F) || (c == 0x7F))
throw new IllegalArgumentException(msg + ": Control characters not allowed in RFC2616 token"); throw new IllegalArgumentException(msg + ": RFC2616 tokens may not contain control characters");
if (c == '(' || c == ')' || c == '<' || c == '>' || c == '@' if (c == '(' || c == ')' || c == '<' || c == '>' || c == '@'
|| c == ',' || c == ';' || c == ':' || c == '\\' || c == '"' || c == ',' || c == ';' || c == ':' || c == '\\' || c == '"'
|| c == '/' || c == '[' || c == ']' || c == '?' || c == '=' || c == '/' || c == '[' || c == ']' || c == '?' || c == '='
|| c == '{' || c == '}' || c == ' ') || c == '{' || c == '}' || c == ' ')
{ {
throw new IllegalArgumentException(msg + ": RFC2616 token may not contain separator character: [" + c + "]"); throw new IllegalArgumentException(msg + ": RFC2616 tokens may not contain separator character: [" + c + "]");
} }
if (c >= 0x80) if (c >= 0x80)
throw new IllegalArgumentException(msg + ": RFC2616 token characters restricted to US-ASCII range: 0x" + Integer.toHexString(c)); throw new IllegalArgumentException(msg + ": RFC2616 tokens characters restricted to US-ASCII: 0x" + Integer.toHexString(c));
} }
} }
@ -113,7 +113,7 @@ public final class Syntax
// Has starting DQUOTE // Has starting DQUOTE
if (valueLen <= 1 || (value.charAt(valueLen - 1) != '"')) if (valueLen <= 1 || (value.charAt(valueLen - 1) != '"'))
{ {
throw new IllegalArgumentException("RFC6265 Cookie value must have balanced DQUOTES (if used)"); throw new IllegalArgumentException("RFC6265 Cookie values must have balanced DQUOTES (if used)");
} }
// adjust search range to exclude DQUOTES // adjust search range to exclude DQUOTES
@ -127,16 +127,16 @@ public final class Syntax
// 0x00 - 0x1F are low order control characters // 0x00 - 0x1F are low order control characters
// 0x7F is the DEL control character // 0x7F is the DEL control character
if ((c <= 0x1F) || (c == 0x7F)) if ((c <= 0x1F) || (c == 0x7F))
throw new IllegalArgumentException("Control characters not allowed in RFC6265 Cookie value"); throw new IllegalArgumentException("RFC6265 Cookie values may not contain control characters");
if ((c == ' ' /* 0x20 */) || if ((c == ' ' /* 0x20 */) ||
(c == '"' /* 0x2C */) || (c == '"' /* 0x2C */) ||
(c == ';' /* 0x3B */) || (c == ';' /* 0x3B */) ||
(c == '\\' /* 0x5C */)) (c == '\\' /* 0x5C */))
{ {
throw new IllegalArgumentException("RFC6265 Cookie value may not contain character: [" + c + "]"); throw new IllegalArgumentException("RFC6265 Cookie values may not contain character: [" + c + "]");
} }
if (c >= 0x80) if (c >= 0x80)
throw new IllegalArgumentException("RFC6265 Cookie value characters restricted to US-ASCII range: 0x" + Integer.toHexString(c)); throw new IllegalArgumentException("RFC6265 Cookie values characters restricted to US-ASCII: 0x" + Integer.toHexString(c));
} }
} }
} }