You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Objects created with Object.create(null) do not have a toString function defined on them. validator.toString relies on this toString method and if it is not defined it falls into the next execution block that eventually tries to call isNaN on that object. This causes an error.
TypeError: Cannot convert object to primitive value
at isNaN (native)
at Object.validator.toString (/<>/node_modules/validator/validator.js:131:71)
...
This is exposed when using this library in restify. If an object is passed in via a request param (i.e. /api/endpoint?someparam=someEscapedObject), the resulting parsed object does not have a toString function on it. This scenario may not be super common but will cause an error if encountered.
The text was updated successfully, but these errors were encountered:
Objects created with Object.create(null) do not have a
toString
function defined on them.validator.toString
relies on thistoString
method and if it is not defined it falls into the next execution block that eventually tries to callisNaN
on that object. This causes an error.This is exposed when using this library in
restify
. If an object is passed in via a request param (i.e./api/endpoint?someparam=someEscapedObject
), the resulting parsed object does not have atoString
function on it. This scenario may not be super common but will cause an error if encountered.The text was updated successfully, but these errors were encountered: