summaryrefslogtreecommitdiffhomepage
path: root/response.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2023-01-06 19:25:51 +0100
committerRoland Reichwein <mail@reichwein.it>2023-01-06 19:25:51 +0100
commit1e6cca9ca8c4771b05f419a23cd3bb1bbc1f0e38 (patch)
tree4fdeacee76c24a9704d4741910020311bd95cdfb /response.cpp
parentccbfd4b39162a6a320ed400635ebae2992cecd61 (diff)
More HTTP tests
Diffstat (limited to 'response.cpp')
-rw-r--r--response.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/response.cpp b/response.cpp
index 17d3e48..29176af 100644
--- a/response.cpp
+++ b/response.cpp
@@ -319,11 +319,11 @@ response_type generate_response(request_type& req, Server& server)
std::string res_data { plugin->generate_page(GetServerParamFunction, GetRequestParamFunction, SetResponseHeaderFunction)};
if (req.method() == http::verb::head) {
- res.content_length(res_data.size());
+ res.body() = std::string{};
} else {
res.body() = res_data;
- res.prepare_payload();
}
+ res.prepare_payload();
return HttpStatusAndStats("200", "OK", req_ctx, res);
} catch(const std::out_of_range& ex) {