Refine the parsing of response status line; add UT for utility.

This commit is contained in:
Chunting Gu
2019-05-31 13:43:44 +08:00
parent 78743e6a55
commit 2035c1f552
10 changed files with 81 additions and 21 deletions
+2 -2
View File
@@ -98,7 +98,7 @@ std::vector<Header>::iterator Headers::Find(const std::string& key) {
static bool ParseValue(const std::string& str, const std::string& expected_key,
std::string* value) {
std::string key;
if (!Split2(str, '=', &key, value)) {
if (!SplitKV(str, '=', &key, value)) {
return false;
}
@@ -182,7 +182,7 @@ bool ContentDisposition::Init(const std::string& str) {
std::string key;
std::string value;
for (std::size_t i = 1; i < parts.size(); ++i) {
if (!Split2(parts[i], '=', &key, &value)) {
if (!SplitKV(parts[i], '=', &key, &value)) {
return false;
}