фикс входа в браузере opera gx
This commit is contained in:
@@ -113,7 +113,20 @@ std::map<std::string, std::string> http::utils::parseCookies(const std::string&
|
||||
if (equalPos == std::string::npos) {
|
||||
continue; // Неверный формат Cookie
|
||||
}
|
||||
std::string name = cookie.substr(0, equalPos);
|
||||
size_t startIndex = 0;
|
||||
while (startIndex < cookie.size()) {
|
||||
if (cookie[startIndex] == '=') {
|
||||
// некорректная кука, состоит только из пробелов, так что на этом обработку и закончим
|
||||
return cookies;
|
||||
}
|
||||
|
||||
if (cookie[startIndex] == ' ') {
|
||||
startIndex++;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
std::string name = cookie.substr(startIndex, equalPos - startIndex);
|
||||
std::string value = cookie.substr(equalPos + 1);
|
||||
|
||||
// Удаляем пробелы с начала и конца значения Cookie
|
||||
|
Reference in New Issue
Block a user