cookieJar.setCookieSync ignore error
cookieJar.setCookieSync crash node when error, like: ``` uncaughtException: Error: Cookie not in this host's domain. Cookie:example.com Request:127.0.0.1 ```
This commit is contained in:
1 parent
02b0604ad7
commit
f109ffa9bc
1 file changed
+2
-1
@@ -33,7 +33,8 @@ export function addCookieToJar(url, headers) {
|
||||
cookies = [cookie];
|
||||
}
|
||||
|
||||
const options = { ignoreError: true };
|
||||
for (let i = 0; i < cookies.length; i += 1) {
|
||||
cookieJar.setCookieSync(cookies[i], url.toString());
|
||||
cookieJar.setCookieSync(cookies[i], url.toString(), options);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user