fix Cookie.hasExpired() for session cookies

bump patch version
This commit is contained in:
jkhsjdhjs 2019-08-17 05:13:22 +02:00
parent c9dc1d99ed
commit 7b5998327d
Signed by: jkhsjdhjs
GPG Key ID: BAC6ADBAB7D576CC
3 changed files with 3 additions and 3 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "node-fetch-cookies", "name": "node-fetch-cookies",
"version": "1.2.1", "version": "1.2.2",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "node-fetch-cookies", "name": "node-fetch-cookies",
"version": "1.2.1", "version": "1.2.2",
"description": "node-fetch wrapper that adds support for cookie-jars", "description": "node-fetch wrapper that adds support for cookie-jars",
"main": "src/index.mjs", "main": "src/index.mjs",
"engines": { "engines": {

View File

@ -118,7 +118,7 @@ export default class Cookie {
return this.name + "=" + this.value; return this.name + "=" + this.value;
} }
hasExpired(sessionEnded) { hasExpired(sessionEnded) {
return sessionEnded && this.expiry === null || this.expiry < new Date(); return sessionEnded && this.expiry === null || this.expiry && this.expiry < new Date();
} }
isValidForRequest(requestURL) { isValidForRequest(requestURL) {
if(this.hasExpired(false)) if(this.hasExpired(false))