mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 09:18:27 +00:00
Fix #608
This commit is contained in:
parent
649b1d2172
commit
b2b4f7635f
1 changed files with 1 additions and 0 deletions
|
@ -175,6 +175,7 @@ svr.Get("/stream", [&](const Request &req, Response &res) {
|
|||
|
||||
res.set_content_provider(
|
||||
data->size(), // Content length
|
||||
"text/plain", // Content type
|
||||
[data](size_t offset, size_t length, DataSink &sink) {
|
||||
const auto &d = *data;
|
||||
sink.write(&d[offset], std::min(length, DATA_CHUNK_SIZE));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue