diff options
author | Piotr Sikora <piotr@cloudflare.com> | 2014-10-27 14:25:56 -0700 |
---|---|---|
committer | Piotr Sikora <piotr@cloudflare.com> | 2014-10-27 14:25:56 -0700 |
commit | 54606d4625e69730dd6b45cba4117215390d284e (patch) | |
tree | 1d8438ae7dd94cb1bdc8ae1fe80ab511f467c66b /src | |
parent | 78dd8b5eda96905eac15f1e7edfc9e898a175cec (diff) | |
download | nginx-54606d4625e69730dd6b45cba4117215390d284e.tar.gz nginx-54606d4625e69730dd6b45cba4117215390d284e.zip |
SPDY: stop emitting multiple empty header values.
Previously, nginx would emit empty values in a header with multiple,
NULL-separated values.
This is forbidden by the SPDY specification, which requires headers to
have either a single (possibly empty) value or multiple, NULL-separated
non-empty values.
Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/http/ngx_http_spdy_filter_module.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/http/ngx_http_spdy_filter_module.c b/src/http/ngx_http_spdy_filter_module.c index d1406a665..377e93520 100644 --- a/src/http/ngx_http_spdy_filter_module.c +++ b/src/http/ngx_http_spdy_filter_module.c @@ -493,9 +493,13 @@ ngx_http_spdy_header_filter(ngx_http_request_t *r) continue; } - *last++ = '\0'; + if (h[j].value.len) { + if (last != p) { + *last++ = '\0'; + } - last = ngx_cpymem(last, h[j].value.data, h[j].value.len); + last = ngx_cpymem(last, h[j].value.data, h[j].value.len); + } h[j].hash = 2; } |