Add endWithoutBody

This commit is contained in:
Alex Hultman
2021-11-13 11:59:47 +01:00
parent 9a5bc5d09c
commit 00deb291e3
+5
View File
@@ -379,6 +379,11 @@ public:
return this;
}
/* End without a body (no content-length) or end with a spoofed content-length. */
void endWithoutBody(std::optional<size_t> reportedContentLength = std::nullopt, bool closeConnection = false) {
internalEnd({nullptr, 0}, false, false, closeConnection);
}
/* End the response with an optional data chunk. Always starts a timeout. */
void end(std::string_view data = {}, bool closeConnection = false) {
internalEnd(data, data.length(), false, true, closeConnection);