From baa9b1cac0d652aa04c40e3affe3ff7115be32e9 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 4 Nov 2016 21:16:45 +0900 Subject: [PATCH] nghttpx: Remove optional reason-phrase from SPDY :status --- src/shrpx_spdy_upstream.cc | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/shrpx_spdy_upstream.cc b/src/shrpx_spdy_upstream.cc index b6129e09..eff888be 100644 --- a/src/shrpx_spdy_upstream.cc +++ b/src/shrpx_spdy_upstream.cc @@ -918,9 +918,7 @@ int SpdyUpstream::send_reply(Downstream *downstream, const uint8_t *body, const auto &resp = downstream->response(); auto &balloc = downstream->get_block_allocator(); - auto status_line = concat_string_ref( - balloc, http2::stringify_status(balloc, resp.http_status), - StringRef::from_lit(" "), http2::get_reason_phrase(resp.http_status)); + auto status_line = http2::stringify_status(balloc, resp.http_status); const auto &headers = resp.fs.headers(); @@ -1001,9 +999,7 @@ int SpdyUpstream::error_reply(Downstream *downstream, lgconf->update_tstamp(std::chrono::system_clock::now()); auto content_length = util::make_string_ref_uint(balloc, html.size()); - auto status_line = concat_string_ref( - balloc, http2::stringify_status(balloc, status_code), - StringRef::from_lit(" "), http2::get_reason_phrase(status_code)); + auto status_line = http2::stringify_status(balloc, status_code); const char *nv[] = {":status", status_line.c_str(), ":version", "http/1.1", @@ -1108,9 +1104,8 @@ int SpdyUpstream::on_downstream_header_complete(Downstream *downstream) { size_t hdidx = 0; std::string via_value; - auto status_line = concat_string_ref( - balloc, http2::stringify_status(balloc, resp.http_status), - StringRef::from_lit(" "), http2::get_reason_phrase(resp.http_status)); + auto status_line = http2::stringify_status(balloc, resp.http_status); + nv[hdidx++] = ":status"; nv[hdidx++] = status_line.c_str(); nv[hdidx++] = ":version";