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",
|
"name": "node-fetch-cookies",
|
||||||
"version": "1.2.1",
|
"version": "1.2.2",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -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": {
|
||||||
|
|
|
@ -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))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user