diff options
author | George Hazan <ghazan@miranda.im> | 2020-01-14 11:50:42 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-01-14 11:50:42 +0300 |
commit | 4bc9c8cf9468582a2e860efbc412c7c6e5c67a94 (patch) | |
tree | 777ae93ba72784d6a12f3a9f0fd6cb0f97a46490 /protocols | |
parent | 8c6d68a739cfc5af0921876a40ad1538213c5980 (diff) |
Skype: cookies processing code reverted back
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/SkypeWeb/src/skype_mslogin.cpp | 14 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_oauth.cpp | 7 |
2 files changed, 15 insertions, 6 deletions
diff --git a/protocols/SkypeWeb/src/skype_mslogin.cpp b/protocols/SkypeWeb/src/skype_mslogin.cpp index 30272829f7..fedaa74211 100644 --- a/protocols/SkypeWeb/src/skype_mslogin.cpp +++ b/protocols/SkypeWeb/src/skype_mslogin.cpp @@ -39,9 +39,12 @@ void CSkypeProto::OnMSLoginFirst(const NETLIBHTTPREQUEST *response) }
std::string PPTF = match[1];
- if (auto *pszHdr = Netlib_GetHeader(response, "Set-Cookie")) {
+ for (int i = 0; i < response->headersCount; i++) {
+ if (mir_strcmpi(response->headers[i].szName, "Set-Cookie"))
+ continue;
+
regex = "^(.+?)=(.+?);";
- content = pszHdr;
+ content = response->headers[i].szValue;
if (std::regex_search(content, match, regex))
scookies[match[1]] = match[2];
}
@@ -68,9 +71,12 @@ void CSkypeProto::OnMSLoginSecond(const NETLIBHTTPREQUEST *response) if (std::regex_search(content, match, regex)) {
if (match[1] == "i5600") {
CMStringA szCookies;
- if (auto *pszHdr = Netlib_GetHeader(response, "Set-Cookie")) {
+ for (int i = 0; i < response->headersCount; i++) {
+ if (mir_strcmpi(response->headers[i].szName, "Set-Cookie"))
+ continue;
+
regex = "^(.+?)=(.+?);";
- content = pszHdr;
+ content = response->headers[i].szValue;
if (std::regex_search(content, match, regex))
if (!std::string(match[2]).empty() && std::string(match[2]) != " ")
szCookies.AppendFormat("%s=%s;", std::string(match[1]).c_str(), std::string(match[2]).c_str());
diff --git a/protocols/SkypeWeb/src/skype_oauth.cpp b/protocols/SkypeWeb/src/skype_oauth.cpp index dcb087322b..d00fc7fa10 100644 --- a/protocols/SkypeWeb/src/skype_oauth.cpp +++ b/protocols/SkypeWeb/src/skype_oauth.cpp @@ -39,9 +39,12 @@ void CSkypeProto::OnOAuthStart(const NETLIBHTTPREQUEST *response) } std::string PPTF = match[1]; - if (auto *pszHdr = Netlib_GetHeader(response, "Set-Cookie")) { + for (int i = 0; i < response->headersCount; i++) { + if (mir_strcmpi(response->headers[i].szName, "Set-Cookie")) + continue; + regex = "^(.+?)=(.+?);"; - content = pszHdr; + content = response->headers[i].szValue; if (std::regex_search(content, match, regex)) scookies[match[1]] = match[2]; } |