Request
Null-crypto opened this issue · 1 comments
Null-crypto commented
I'm finding this lib extremely helpful but the console.warn for ignored cookies is very inconvenient. Could I kindly ask that it is removed or made optional.
addCookie(cookie, fromURL) {
if(typeof cookie === "string") {
try {
cookie = new Cookie(cookie, fromURL);
}
catch(error) {
if(error instanceof CookieParseError) {
console.warn("Ignored cookie: " + cookie);
console.warn("Reason: " + error.message);
return false;
}
throw error;
}
}
jkhsjdhjs commented
I made it optional. You can now pass a callback function to the CookieJar constructor which is called when a cookie has been ignored: https://github.com/jkhsjdhjs/node-fetch-cookies#new-cookiejarfile-flags--rw-cookies-cookieignorecallback