nghttpx: Check Content-Length only when Transfer-Encoding is not found

This commit is contained in:
Tatsuhiro Tsujikawa 2015-01-19 21:16:47 +09:00
parent fff785178d
commit e8053ac931
1 changed files with 8 additions and 5 deletions

View File

@ -767,11 +767,14 @@ void Downstream::inspect_http1_response() {
chunked_response_ = true;
}
idx = response_hdidx_[http2::HD_CONTENT_LENGTH];
if (idx != -1) {
auto len = util::parse_uint(response_headers_[idx].value);
if (len != -1) {
response_content_length_ = len;
// examine Content-Length only when Transfer-Encoding is missing
if (idx == -1) {
idx = response_hdidx_[http2::HD_CONTENT_LENGTH];
if (idx != -1) {
auto len = util::parse_uint(response_headers_[idx].value);
if (len != -1) {
response_content_length_ = len;
}
}
}
}