From 5c82a36072f9da448aa0d30414912fcc28c3d98d Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 14 May 2016 17:29:29 +0900 Subject: [PATCH] nghttpd: Set content-length in status response --- src/HttpServer.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/HttpServer.cc b/src/HttpServer.cc index 893f731d..5070a26b 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -1121,8 +1121,12 @@ void prepare_status_response(Stream *stream, Http2Handler *hd, int status) { data_prd.read_callback = file_read_callback; HeaderRefs headers; + headers.reserve(2); headers.emplace_back(StringRef::from_lit("content-type"), StringRef::from_lit("text/html; charset=UTF-8")); + headers.emplace_back( + StringRef::from_lit("content-length"), + util::make_string_ref_uint(stream->balloc, file_ent->length)); hd->submit_response(StringRef{status_page->status}, stream->stream_id, headers, &data_prd); }