Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returned null in case of empty cookie value #196

Merged
merged 7 commits into from
Feb 16, 2021
3 changes: 3 additions & 0 deletions lib/cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,9 @@ class CookieJar {
if (validators.isFunction(options)) {
cb = options;
options = {};

if(typeof cookie === 'string' && cookie.length <= 0 )
vsin12 marked this conversation as resolved.
Show resolved Hide resolved
return cb(null);
}
validators.validate(validators.isFunction(cb), cb);
vsin12 marked this conversation as resolved.
Show resolved Hide resolved

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just looked at this in context, and I think this is fine. Will discuss today.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see comment below; I think we may want an Error here.

Expand Down