diff --git a/registry/service/HttpServer.cpp b/registry/service/HttpServer.cpp index c329128..ea344cd 100644 --- a/registry/service/HttpServer.cpp +++ b/registry/service/HttpServer.cpp @@ -227,17 +227,14 @@ Void::Result::Result HttpServer::start(const HttpServ } bridged.body = request.body; - // HEAD is routed exactly like GET; the body is dropped but Content-Length is preserved. + // HEAD is routed exactly like GET; the body stays so the transport can + // derive the GET Content-Length, and Void::Net suppresses the body itself. const bool head_only = request.method == Void::Net::Method::Head; if (head_only) { bridged.method = "GET"; } HttpResponse response = handler(bridged); apply_default_security_headers(response); - if (head_only) { - response.headers["Content-Length"] = std::to_string(response.body.size()); - response.body.clear(); - } Void::Net::ServerResponse net_response; net_response.status = response.status; for (const auto &[name, value] : response.headers) {