Skip to content

Commit

Permalink
fix ithewei#324: HttpCookie supports saving multiple names
Browse files Browse the repository at this point in the history
  • Loading branch information
ithewei committed Dec 23, 2022
1 parent 397aaba commit c09a3e2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions http/HttpMessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,19 @@ std::string HttpCookie::dump() const {
assert(!name.empty() || !kv.empty());
std::string res;

if (!name.empty()) {
if (!kv.empty()) {
for (auto& pair : kv) {
if (!res.empty()) res += "; ";
res += pair.first;
res += "=";
res += pair.second;
}
} else {
res = name;
res += "=";
res += value;
}

for (auto& pair : kv) {
if (!res.empty()) res += "; ";
res += pair.first;
res += "=";
res += pair.second;
}

if (!domain.empty()) {
res += "; Domain=";
res += domain;
Expand Down

0 comments on commit c09a3e2

Please sign in to comment.