Refine the connection close

This commit is contained in:
Chunting Gu
2019-07-15 15:36:30 +08:00
parent 2a20030f7e
commit 46ea52cb90
24 changed files with 214 additions and 147 deletions
+6 -2
View File
@@ -32,10 +32,14 @@ ResponsePtr ResponseBuilder::operator()() {
}
}
#endif // WEBCC_ENABLE_GZIP
response->SetBody(body_, true);
} else {
// Ensure the existing of `Content-Length` header if the body is empty.
// `Content-Length: 0` is required by most HTTP clients (e.g., Chrome).
body_ = std::make_shared<webcc::Body>();
}
response->SetBody(body_, true);
return response;
}