From 30b88fde9e8b35fe6b572626be0029329ed68530 Mon Sep 17 00:00:00 2001 From: Alex Hultman Date: Sat, 13 Nov 2021 12:07:25 +0100 Subject: [PATCH] Only support endWithoutBody() for now --- src/HttpResponse.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/HttpResponse.h b/src/HttpResponse.h index f6b2cff..71111f3 100644 --- a/src/HttpResponse.h +++ b/src/HttpResponse.h @@ -381,7 +381,11 @@ public: /* End without a body (no content-length) or end with a spoofed content-length. */ void endWithoutBody(std::optional reportedContentLength = std::nullopt, bool closeConnection = false) { - internalEnd({nullptr, 0}, false, false, closeConnection); + if (reportedContentLength.has_value()) { + //internalEnd({nullptr, 0}, reportedContentLength.value(), false, true, closeConnection); + } else { + internalEnd({nullptr, 0}, 0, false, false, closeConnection); + } } /* End the response with an optional data chunk. Always starts a timeout. */