0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-25 23:14:13 +01:00

ircd::http: Response ctor content_length=-1 is chunked encoding.

This commit is contained in:
Jason Volk 2018-03-22 00:37:16 -07:00
parent ef0a3d6e6c
commit 51714d2b67

View file

@ -352,7 +352,7 @@ ircd::http::response::response(window_buffer &out,
};
});
if(code != NO_CONTENT && content_length != std::numeric_limits<size_t>::max())
if(code != NO_CONTENT && content_length != size_t(-1))
writeline(out, [&content_length](const mutable_buffer &out) -> size_t
{
return fmt::sprintf
@ -361,6 +361,12 @@ ircd::http::response::response(window_buffer &out,
};
});
if(content_length == size_t(-1))
writeline(out, [&content_length](const mutable_buffer &out) -> size_t
{
return copy(out, "Transfer-Encoding: chunked"_sv);
});
if(!headers_string.empty())
out([&headers_string](const mutable_buffer &out)
{