summaryrefslogtreecommitdiff
path: root/protocols/VKontakte
diff options
context:
space:
mode:
authorElzorFox <elzorfox@ya.ru>2020-01-14 13:38:33 +0500
committerElzorFox <elzorfox@ya.ru>2020-01-14 13:38:33 +0500
commit8c6d68a739cfc5af0921876a40ad1538213c5980 (patch)
tree3441e416b3660b598e12df632426a258af6c9448 /protocols/VKontakte
parent92a41c53c7afd4b0670a67c60091974bb6ebccc5 (diff)
VKontakte: login fix (header ‘Set-cookie’ can occur more than once)
Diffstat (limited to 'protocols/VKontakte')
-rw-r--r--protocols/VKontakte/src/misc.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index d94361bb96..4fe0e82eb5 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -478,8 +478,11 @@ CMStringW CVkProto::RunRenameNick(LPCWSTR pwszOldName)
void CVkProto::GrabCookies(NETLIBHTTPREQUEST *nhr)
{
debugLogA("CVkProto::GrabCookies");
- if (auto *pszCookie = Netlib_GetHeader(nhr, "Set-cookie")) {
- CMStringA szValue = pszCookie, szCookieName, szCookieVal, szDomain;
+ for (int i = 0; i < nhr->headersCount; i++) {
+ if (_stricmp(nhr->headers[i].szName, "Set-cookie"))
+ continue;
+
+ CMStringA szValue = nhr->headers[i].szValue, szCookieName, szCookieVal, szDomain;
int iStart = 0;
while (true) {
bool bFirstToken = (iStart == 0);