Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Oh... I found small bug #17

boris-42 opened this Issue · 5 comments

4 participants


For example If you have form:

<form ...>
 <input type="text" name="email"/> 
 <input type="text" name="email"/>
 <input type="submit"/>

And then try to make on server

req.assert("email", "Invalid email" ).notNull().isEmail();

throws error =)

Something like this:
TypeError: Object,test, has no method 'match'

So ten year old "hacker" with curl can easy drop my web site using such things=)


@pboris can you provide a more complete code sample to reproduce this issue? That would be great!


I have not tried to reproduce this, but I wonder if what pboris is seeing could be handled by changing to use the Validator prototype. I see on the node validator repo an example using it:

Validator.prototype.error = function (msg) {
    return this;

Maybe placing the error function on the instance lets a thrown error get through?


@smakinson can you provide an example?


Now that I am coming back to this and looking at the node-validator page again, I think I mis-spoke since error handlers can be added in both places. But I just saw an error like this on something else I am using and I'd guess he is seeing an error from calling match on something that is not a string. Perhaps a side effect from the chaining?

I have not written any code to investigate.


Closing as this conversation was going nowhere and no has responded since 2013.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.