From 1e6cca9ca8c4771b05f419a23cd3bb1bbc1f0e38 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Fri, 6 Jan 2023 19:25:51 +0100 Subject: More HTTP tests --- response.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'response.cpp') 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) { -- cgit v1.2.3