Skip to content

Commit

Permalink
fix GetCookie with multi name=value (#516)
Browse files Browse the repository at this point in the history
  • Loading branch information
ithewei committed Apr 10, 2024
1 parent a59b2d0 commit 0984b61
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions http/HttpMessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,12 @@ const HttpCookie& HttpMessage::GetCookie(const std::string& name) {
if (iter->name == name) {
return *iter;
}
auto kv_iter = iter->kv.find(name);
if (kv_iter != iter->kv.end()) {
iter->name = name;
iter->value = kv_iter->second;
return *iter;
}
}
return NoCookie;
}
Expand Down

0 comments on commit 0984b61

Please sign in to comment.