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. */