diff --git a/package-lock.json b/package-lock.json index ef218ee..dee38e9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "node-fetch-cookies", - "version": "1.2.1", + "version": "1.2.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f35d96c..b1dc497 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-fetch-cookies", - "version": "1.2.1", + "version": "1.2.2", "description": "node-fetch wrapper that adds support for cookie-jars", "main": "src/index.mjs", "engines": { diff --git a/src/cookie.mjs b/src/cookie.mjs index e80ea8e..85675ac 100644 --- a/src/cookie.mjs +++ b/src/cookie.mjs @@ -118,7 +118,7 @@ export default class Cookie { return this.name + "=" + this.value; } hasExpired(sessionEnded) { - return sessionEnded && this.expiry === null || this.expiry < new Date(); + return sessionEnded && this.expiry === null || this.expiry && this.expiry < new Date(); } isValidForRequest(requestURL) { if(this.hasExpired(false))