Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
cookies.forEach(function (cookie) {
if (cookie.is_secure && !isSecure) {
return;
}
if (!tough.domainMatch(host, cookie.host_key, true)) {
return;
}
if (!tough.pathMatch(path, cookie.path)) {
return;
}
validCookies.push(cookie);
});
cookies = cookies.filter(cookie => Tough.pathMatch(identifier.path, cookie.path));
if (identifier.domain)
const cookieMatches = (cookie: CyCookie, data) => {
if (data.domain && !tough.domainMatch(cookie.domain, data.domain)) {
return false
}
if (data.path && !tough.pathMatch(cookie.path, data.path)) {
return false
}
if (data.name && data.name !== cookie.name) {
return false
}
return true
}