Refine the connection close
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user