From 3b85d6e4e8dcebdd0eee6142d57c788e21888dea Mon Sep 17 00:00:00 2001 From: yhirose Date: Wed, 15 Jul 2015 16:39:57 -0400 Subject: [PATCH] Fixed problem with content length 0. --- httplib.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/httplib.h b/httplib.h index c891118..93ddb11 100644 --- a/httplib.h +++ b/httplib.h @@ -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"); }