nghttpx: Don't forward Trailer header field

This commit is contained in:
Tatsuhiro Tsujikawa 2015-01-14 21:33:22 +09:00
parent 1de20c1232
commit aa1c8d1fa4
3 changed files with 9 additions and 0 deletions

View File

@ -20,6 +20,7 @@ HEADERS = [
"alt-svc",
"content-length",
"location",
"trailer",
# disallowed h1 headers
'connection',
'keep-alive',

View File

@ -239,6 +239,7 @@ void copy_headers_to_nva(std::vector<nghttp2_nv> &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;

View File

@ -203,6 +203,7 @@ enum {
HD_PROXY_CONNECTION,
HD_SERVER,
HD_TE,
HD_TRAILER,
HD_TRANSFER_ENCODING,
HD_UPGRADE,
HD_VIA,