fix Cookie.hasExpired() for session cookies
bump patch version
This commit is contained in:
parent
c9dc1d99ed
commit
7b5998327d
2
package-lock.json
generated
2
package-lock.json
generated
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "node-fetch-cookies",
|
||||
"version": "1.2.1",
|
||||
"version": "1.2.2",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
|
@ -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": {
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue
Block a user