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 -4
View File
@@ -85,10 +85,12 @@ void Message::SetContentType(const std::string& media_type,
const std::string& charset) {
using headers::kContentType;
if (charset.empty()) {
SetHeader(kContentType, media_type);
} else {
SetHeader(kContentType, media_type + "; charset=" + charset);
if (!media_type.empty()) {
if (charset.empty()) {
SetHeader(kContentType, media_type);
} else {
SetHeader(kContentType, media_type + "; charset=" + charset);
}
}
}