From aa1c8d1fa4c03ff4bce3eae1bc929384e8ca92c4 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 14 Jan 2015 21:33:22 +0900 Subject: [PATCH] nghttpx: Don't forward Trailer header field --- genheaderfunc.py | 1 + src/http2.cc | 7 +++++++ src/http2.h | 1 + 3 files changed, 9 insertions(+) diff --git a/genheaderfunc.py b/genheaderfunc.py index 17894359..c4fba627 100755 --- a/genheaderfunc.py +++ b/genheaderfunc.py @@ -20,6 +20,7 @@ HEADERS = [ "alt-svc", "content-length", "location", + "trailer", # disallowed h1 headers 'connection', 'keep-alive', diff --git a/src/http2.cc b/src/http2.cc index a0d94344..4120f2ac 100644 --- a/src/http2.cc +++ b/src/http2.cc @@ -239,6 +239,7 @@ void copy_headers_to_nva(std::vector &nva, const Headers &headers) { case HD_KEEP_ALIVE: case HD_PROXY_CONNECTION: case HD_SERVER: + case HD_TRAILER: case HD_TRANSFER_ENCODING: case HD_UPGRADE: case HD_VIA: @@ -263,6 +264,7 @@ void build_http1_headers_from_headers(std::string &hdrs, case HD_KEEP_ALIVE: case HD_PROXY_CONNECTION: case HD_SERVER: + case HD_TRAILER: case HD_UPGRADE: case HD_VIA: case HD_X_FORWARDED_FOR: @@ -506,6 +508,11 @@ int lookup_token(const uint8_t *name, size_t namelen) { return HD_UPGRADE; } break; + case 'r': + if (util::streq("traile", name, 6)) { + return HD_TRAILER; + } + break; case 's': if (util::streq(":statu", name, 6)) { return HD__STATUS; diff --git a/src/http2.h b/src/http2.h index c21cfe7b..74049eac 100644 --- a/src/http2.h +++ b/src/http2.h @@ -203,6 +203,7 @@ enum { HD_PROXY_CONNECTION, HD_SERVER, HD_TE, + HD_TRAILER, HD_TRANSFER_ENCODING, HD_UPGRADE, HD_VIA,