ByteString misses encountered during forward port

Motivation:
While forward porting https://github.com/netty/netty/pull/3579 there were a few areas that had not been previously back ported.

Modifications:
Backport the missed areas to ensure consistency.

Result:
More consistent 4.1 and master branches.
This commit is contained in:
Scott Mitchell 2015-04-14 17:11:09 -07:00
parent 9a7a85dbe5
commit e36c1436b8
2 changed files with 3 additions and 1 deletions

View File

@ -150,6 +150,8 @@ public class DefaultHttpHeaders extends HttpHeaders {
if ((c & HIGHEST_INVALID_VALUE_CHAR_MASK) == 0) { if ((c & HIGHEST_INVALID_VALUE_CHAR_MASK) == 0) {
// Check the absolutely prohibited characters. // Check the absolutely prohibited characters.
switch (c) { switch (c) {
case 0x0: // NULL
throw new IllegalArgumentException("a header value contains a prohibited character '\0': " + seq);
case 0x0b: // Vertical tab case 0x0b: // Vertical tab
throw new IllegalArgumentException("a header value contains a prohibited character '\\v': " + seq); throw new IllegalArgumentException("a header value contains a prohibited character '\\v': " + seq);
case '\f': case '\f':

View File

@ -377,7 +377,7 @@ public final class HttpUtil {
throw streamError(streamId, PROTOCOL_ERROR, throw streamError(streamId, PROTOCOL_ERROR,
"Invalid HTTP/2 header '%s' encountered in translation to HTTP/1.x", translatedName); "Invalid HTTP/2 header '%s' encountered in translation to HTTP/1.x", translatedName);
} else { } else {
output.add(translatedName.toString(), value); output.add(new AsciiString(translatedName.array(), false), new AsciiString(value.array(), false));
} }
} }
return true; return true;