mirror of
https://github.com/yhirose/cpp-httplib
synced 2024-11-21 14:29:10 -07:00
Fixed problem with content length 0.
This commit is contained in:
parent
cb473e8534
commit
3b85d6e4e8
1 changed files with 1 additions and 5 deletions
|
@ -404,11 +404,7 @@ inline void write_headers(FILE* fp, const T& res)
|
|||
|
||||
auto t = get_header_value(res.headers, "Content-Type", "text/plain");
|
||||
fprintf(fp, "Content-Type: %s\r\n", t);
|
||||
|
||||
if (!res.body.empty()) {
|
||||
fprintf(fp, "Content-Length: %ld\r\n", res.body.size());
|
||||
}
|
||||
|
||||
fprintf(fp, "Content-Length: %ld\r\n", res.body.size());
|
||||
fprintf(fp, "\r\n");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue