-
Notifications
You must be signed in to change notification settings - Fork 289
Closed
Milestone
Description
I noticed missing parameter validation in the setCookie
function:
Lines 995 to 1001 in 4350705
CookieJar.prototype.setCookie = function(cookie, url, options, cb) { | |
var err; | |
var context = getCookieContext(url); | |
if (options instanceof Function) { | |
cb = options; | |
options = {}; | |
} |
There is no parameter validation which may cause confusion when not setting url
. If only cookies
then the function will assume that the options
parameter is an object and tries to access the loose
property. This will cause a TypeException.
There should either be parameter validation throwing an Error or some kind of handling.
This was found when investigating this bug: valeriangalliat/fetch-cookie#35
Metadata
Metadata
Assignees
Labels
No labels