From 46ccc4332c2217fcc9c7589a81b506b4b5a57455 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 7 Apr 2017 21:45:13 +0900 Subject: [PATCH] nghttpx: Fix bug that 204 from h1 backend is always treated as error --- src/shrpx_http_downstream_connection.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/shrpx_http_downstream_connection.cc b/src/shrpx_http_downstream_connection.cc index aec721be..8c82b3df 100644 --- a/src/shrpx_http_downstream_connection.cc +++ b/src/shrpx_http_downstream_connection.cc @@ -892,13 +892,12 @@ int htp_hdrs_completecb(http_parser *htp) { if (resp.fs.parse_content_length() != 0) { return -1; } - if (resp.fs.content_length != 0) { - return -1; - } if (resp.fs.content_length == 0) { auto cl = resp.fs.header(http2::HD_CONTENT_LENGTH); assert(cl); http2::erase_header(cl); + } else if (resp.fs.content_length != -1) { + return -1; } } else if (resp.http_status / 100 == 1 || (resp.http_status == 200 && req.method == HTTP_CONNECT)) {