From 6a0d9e5b2d9274e5ac5059a674763f19c2731b11 Mon Sep 17 00:00:00 2001 From: Maxim Dounin Date: Sat, 17 Mar 2018 23:04:25 +0300 Subject: gRPC: special handling of the TE request header. According to the gRPC protocol specification, the "TE" header is used to detect incompatible proxies, and at least grpc-c server rejects requests without "TE: trailers". To preserve the logic, we have to pass "TE: trailers" to the backend if and only if the original request contains "trailers" in the "TE" header. Note that no other TE values are allowed in HTTP/2, so we have to remove anything else. --- src/http/ngx_http_request.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/http/ngx_http_request.c') diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index 89cfe77ad..2db7a6279 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -132,6 +132,10 @@ ngx_http_header_t ngx_http_headers_in[] = { offsetof(ngx_http_headers_in_t, transfer_encoding), ngx_http_process_header_line }, + { ngx_string("TE"), + offsetof(ngx_http_headers_in_t, te), + ngx_http_process_header_line }, + { ngx_string("Expect"), offsetof(ngx_http_headers_in_t, expect), ngx_http_process_unique_header_line }, -- cgit v1.2.3