From 7b5998327d1b255be6a2b23fd4203d291c15f684 Mon Sep 17 00:00:00 2001 From: jkhsjdhjs Date: Sat, 17 Aug 2019 05:13:22 +0200 Subject: [PATCH] fix Cookie.hasExpired() for session cookies bump patch version --- package-lock.json | 2 +- package.json | 2 +- src/cookie.mjs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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))