Commit 5c82a360 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttpd: Set content-length in status response

parent b011012d
...@@ -1121,8 +1121,12 @@ void prepare_status_response(Stream *stream, Http2Handler *hd, int status) { ...@@ -1121,8 +1121,12 @@ void prepare_status_response(Stream *stream, Http2Handler *hd, int status) {
data_prd.read_callback = file_read_callback; data_prd.read_callback = file_read_callback;
HeaderRefs headers; HeaderRefs headers;
headers.reserve(2);
headers.emplace_back(StringRef::from_lit("content-type"), headers.emplace_back(StringRef::from_lit("content-type"),
StringRef::from_lit("text/html; charset=UTF-8")); 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, hd->submit_response(StringRef{status_page->status}, stream->stream_id,
headers, &data_prd); headers, &data_prd);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment