1
0
mirror of synced 2025-04-21 22:25:55 +03:00
This commit is contained in:
yhirose 2020-08-11 12:11:05 -04:00
parent 649b1d2172
commit b2b4f7635f

View File

@ -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));