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:
parent
ef0a3d6e6c
commit
51714d2b67
1 changed files with 7 additions and 1 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue