Repository: trafficserver Updated Branches: refs/heads/master 1cbe7c70b -> 14f0599e6
TS-3814 Treat requests with Connection header field as malformed, as per specs Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/14f0599e Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/14f0599e Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/14f0599e Branch: refs/heads/master Commit: 14f0599e6342ae4944c95a052fc27c3c895b0d94 Parents: 1cbe7c7 Author: Ryo Okubo <[email protected]> Authored: Tue Aug 4 20:18:49 2015 -0600 Committer: Leif Hedstrom <[email protected]> Committed: Tue Aug 4 20:18:49 2015 -0600 ---------------------------------------------------------------------- proxy/http2/HTTP2.cc | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/14f0599e/proxy/http2/HTTP2.cc ---------------------------------------------------------------------- diff --git a/proxy/http2/HTTP2.cc b/proxy/http2/HTTP2.cc index 3b4ad96..3a84a59 100644 --- a/proxy/http2/HTTP2.cc +++ b/proxy/http2/HTTP2.cc @@ -534,16 +534,6 @@ convert_from_2_to_1_1_header(HTTPHdr *headers) headers->field_delete(HPACK_VALUE_STATUS, HPACK_LEN_STATUS); } - // Intermediaries SHOULD also remove other connection- - // specific header fields, such as Keep-Alive, Proxy-Connection, - // Transfer-Encoding and Upgrade, even if they are not nominated by - // Connection. - headers->field_delete(MIME_FIELD_CONNECTION, MIME_LEN_CONNECTION); - headers->field_delete(MIME_FIELD_KEEP_ALIVE, MIME_LEN_KEEP_ALIVE); - headers->field_delete(MIME_FIELD_PROXY_CONNECTION, MIME_LEN_PROXY_CONNECTION); - headers->field_delete(MIME_FIELD_TRANSFER_ENCODING, MIME_LEN_TRANSFER_ENCODING); - headers->field_delete(MIME_FIELD_UPGRADE, MIME_LEN_UPGRADE); - return PARSE_DONE; } @@ -710,6 +700,11 @@ http2_parse_header_fragment(HTTPHdr *hdr, IOVec iov, Http2DynamicTable &dynamic_ return HPACK_ERROR_HTTP2_PROTOCOL_ERROR; } + // rfc7540,sec8.1.2.2: Any message containing connection-specific header fields MUST be treated as malformed + if (name == MIME_FIELD_CONNECTION) { + return HPACK_ERROR_HTTP2_PROTOCOL_ERROR; + } + // :path pseudo header MUST NOT empty for http or https URIs if (static_cast<unsigned>(name_len) == HPACK_LEN_PATH && strncmp(name, HPACK_VALUE_PATH, name_len) == 0) { int value_len = 0;
