summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mir_app/src/MHttpHeaders.cpp14
-rw-r--r--src/mir_app/src/netlib_http.cpp2
2 files changed, 10 insertions, 6 deletions
diff --git a/src/mir_app/src/MHttpHeaders.cpp b/src/mir_app/src/MHttpHeaders.cpp
index 7681f2aa1b..8fad0a1768 100644
--- a/src/mir_app/src/MHttpHeaders.cpp
+++ b/src/mir_app/src/MHttpHeaders.cpp
@@ -70,13 +70,17 @@ CMStringA MHttpHeaders::GetCookies() const
if (mir_strcmpi(it->szName, "Set-Cookie"))
continue;
- if (!ret.IsEmpty())
- ret.Append("; ");
-
+ CMStringA szCookie;
if (const char *p = strchr(it->szValue, ';'))
- ret.Append(it->szValue, p - it->szValue.get());
+ szCookie.Append(it->szValue, p - it->szValue.get());
else
- ret.Append(it->szValue);
+ szCookie = it->szValue;
+
+ szCookie.TrimRight();
+
+ if (!ret.IsEmpty())
+ ret.Append("; ");
+ ret += szCookie;
}
return ret;
}
diff --git a/src/mir_app/src/netlib_http.cpp b/src/mir_app/src/netlib_http.cpp
index 41951bd126..259b6aa670 100644
--- a/src/mir_app/src/netlib_http.cpp
+++ b/src/mir_app/src/netlib_http.cpp
@@ -461,7 +461,7 @@ static MHttpResponse* Netlib_RecvHttpHeaders(NetlibConnection *nlc, int flags)
}
*pColon = 0;
- nlhr->AddHeader(rtrim(pbuffer), lrtrimp(pColon + 1));
+ nlhr->insert(new MHttpHeader(rtrim(pbuffer), lrtrimp(pColon + 1)));
pbuffer = peol + 1;
}