comparison src/http/ngx_http_spdy.c @ 5324:8ef1722143dc

SPDY: do not reject headers with empty value (ticket #396). A quote from SPDY draft 2 specification: "The length of each name and value must be greater than zero. A receiver of a zero-length name or value must send a RST_STREAM with code PROTOCOL error." But it appears that Chrome browser allows sending requests over SPDY/2 connection using JavaScript that contain headers with empty values. For better compatibility across SPDY clients and to be compliant with HTTP, such headers are no longer rejected. Also, it is worth noting that in SPDY draft 3 the statement has been changed so that it permits empty values for headers.
author Valentin Bartenev <vbart@nginx.com>
date Thu, 15 Aug 2013 19:16:09 +0400
parents 2be1a9ce9d8e
children abf7813b927e
comparison
equal deleted inserted replaced
5323:2be1a9ce9d8e 5324:8ef1722143dc
2012 break; 2012 break;
2013 } 2013 }
2014 2014
2015 len = ngx_spdy_frame_parse_uint16(p); 2015 len = ngx_spdy_frame_parse_uint16(p);
2016 2016
2017 if (!len) {
2018 return NGX_ERROR;
2019 }
2020
2021 /* null-terminate header name */ 2017 /* null-terminate header name */
2022 *p = '\0'; 2018 *p = '\0';
2023 2019
2024 p += NGX_SPDY_NV_VLEN_SIZE; 2020 p += NGX_SPDY_NV_VLEN_SIZE;
2025 2021