SPDY codec must check headers are lower case

Motivation:
The SPDY spec requires that all header names be lowercase (see https://www.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3-1#TOC-3.2-HTTP-Request-Response). The SPDY codec header name validator does not enforce this requirement.

Modifications:
- SpdyCodecUtil.validateHeaderName should check for upper case characters and throw an error if any are found.

Result:
SPDY codec header validation enforces specification requirement.
This commit is contained in:
Scott Mitchell 2015-07-29 09:32:59 -07:00
parent f65717be82
commit 209aa28573

View File

@ -305,6 +305,9 @@ final class SpdyCodecUtil {
throw new IllegalArgumentException(
"name contains null character: " + name);
}
if (c >= 'A' && c <= 'Z') {
throw new IllegalArgumentException("name must be all lower case.");
}
if (c > 127) {
throw new IllegalArgumentException(
"name contains non-ascii character: " + name);