summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_oauth.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/SkypeWeb/src/skype_oauth.cpp')
-rw-r--r--protocols/SkypeWeb/src/skype_oauth.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/protocols/SkypeWeb/src/skype_oauth.cpp b/protocols/SkypeWeb/src/skype_oauth.cpp
index a0605346d3..9a9e25df3c 100644
--- a/protocols/SkypeWeb/src/skype_oauth.cpp
+++ b/protocols/SkypeWeb/src/skype_oauth.cpp
@@ -50,11 +50,12 @@ void CSkypeProto::OnOAuthStart(NETLIBHTTPREQUEST *response, AsyncHttpRequest*)
std::string PPFT = match[1];
std::map<std::string, std::string> scookies;
+ regex = "^(.+?)=(.*?);";
+
for (int i = 0; i < response->headersCount; i++) {
if (mir_strcmpi(response->headers[i].szName, "Set-Cookie"))
continue;
- regex = "^(.+?)=(.+?);";
content = response->headers[i].szValue;
if (std::regex_search(content, match, regex))
scookies[match[1]] = match[2];
@@ -102,19 +103,19 @@ void CSkypeProto::OnOAuthConfirm(NETLIBHTTPREQUEST *response, AsyncHttpRequest *
return;
}
- std::regex regex("^(.+?)=(.+?);");
+ std::regex regex("^(.+?=.*?;)");
std::smatch match;
- std::map<std::string, std::string> scookies;
+ CMStringA mscookies;
+
for (int i = 0; i < response->headersCount; i++) {
if (mir_strcmpi(response->headers[i].szName, "Set-Cookie"))
continue;
content = response->headers[i].szValue;
if (std::regex_search(content, match, regex))
- scookies[match[1]] = match[2];
+ mscookies.Append(match[1].str().c_str());
}
- CMStringA mscookies(FORMAT, "MSPRequ=%s;MSPOK=%s;PPAuth=%s;OParams=%s;", cookies["MSPRequ"].c_str(), scookies["MSPOK"].c_str(), scookies["PPAuth"].c_str(), scookies["OParams"].c_str());
PushRequest(new OAuthRequest(mscookies.c_str(), PPFT.c_str(), opid.c_str()));
}