From 4fb1811d18028c642fb1abaac8528e45966e7f65 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 25 Aug 2013 23:28:34 +0900 Subject: [PATCH] nghttpx: Include status code only in :status header field in HTTP2 response --- src/shrpx_http2_upstream.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/shrpx_http2_upstream.cc b/src/shrpx_http2_upstream.cc index d545150b..d73485c7 100644 --- a/src/shrpx_http2_upstream.cc +++ b/src/shrpx_http2_upstream.cc @@ -839,9 +839,9 @@ int Http2Upstream::error_reply(Downstream *downstream, int status_code) data_prd.read_callback = spdy_data_read_callback; std::string content_length = util::utos(html.size()); - + std::string status_code_str = std::to_string(status_code); const char *nv[] = { - ":status", http::get_status_string(status_code), + ":status", status_code_str.c_str(), "content-type", "text/html; charset=UTF-8", "server", get_config()->server_name, "content-length", content_length.c_str(), @@ -909,8 +909,10 @@ int Http2Upstream::on_downstream_header_complete(Downstream *downstream) const char **nv = new const char*[nheader * 2 + 4 + 1]; size_t hdidx = 0; std::string via_value; + std::string response_status = + std::to_string(downstream->get_response_http_status()); nv[hdidx++] = ":status"; - nv[hdidx++] = http::get_status_string(downstream->get_response_http_status()); + nv[hdidx++] = response_status.c_str(); for(Headers::const_iterator i = downstream->get_response_headers().begin(); i != downstream->get_response_headers().end(); ++i) { if(util::strieq((*i).first.c_str(), "transfer-encoding") ||