фикс: зависания соединения с протоколом http

This commit is contained in:
Vladislav Ostapov 2024-11-05 11:31:20 +03:00
parent 3714207983
commit b2ed7ab015

View File

@ -50,9 +50,7 @@ namespace http::server {
void Connection::doWrite() {
reply_.headers.push_back({.name = "Server", .value = SERVER_HEADER_VALUE});
if (!reply_.content.empty()) {
reply_.headers.push_back({.name = "Content-Length", .value = std::to_string(reply_.content.size())});
}
if (request_.http_version_major == 1) {
reply_.headers.push_back({.name = "Connection", .value = "keep-alive"});
}