Validate TE header is legal for HTTP2.

As per draft-16 section 8.1.2.2:
The only exception to this is the TE header field, which MAY be
present in an HTTP/2 request; when it is, it MUST NOT contain any
value other than "trailers".

https://tools.ietf.org/html/draft-ietf-httpbis-http2-16
	Change on 2014/12/01 by ctiller <ctiller@google.com>
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=81111980
pull/1/merge
ctiller 10 years ago committed by Nicolas Noble
parent 097ef9b7d9
commit 03dc30e76e
  1. 7
      src/core/channel/http_server_filter.c

@ -64,6 +64,13 @@ static void call_op(grpc_call_element *elem, grpc_call_op *op) {
/* swallow it */
grpc_mdelem_unref(op->data.metadata);
op->done_cb(op->user_data, GRPC_OP_OK);
} else if (op->data.metadata->key == channeld->te_trailers->key) {
gpr_log(GPR_ERROR, "Invalid te: header: '%s'",
grpc_mdstr_as_c_string(op->data.metadata->value));
/* swallow it */
grpc_mdelem_unref(op->data.metadata);
op->done_cb(op->user_data, GRPC_OP_OK);
grpc_call_element_send_cancel(elem);
} else {
/* pass the event up */
grpc_call_next_op(elem, op);

Loading…
Cancel
Save