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

URLs getting butchered. :( #13

Open
Qard opened this issue Dec 8, 2011 · 5 comments
Open

URLs getting butchered. :( #13

Qard opened this issue Dec 8, 2011 · 5 comments

Comments

@Qard
Copy link

Qard commented Dec 8, 2011

Tried using mongoose-types for URL matching, but it's butchering my URLs. Not particularly liking the edits it's doing. It keeps removing the port number and adding question marks to the end of every URL. >.>

@lalitkapoor
Copy link

+1

1 similar comment
@btamas
Copy link

btamas commented Feb 3, 2012

+1

@lalitkapoor
Copy link

I don't use mongoose-types anymore. I use the following as my validators

var Url = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
var Email = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;

@topliceanu
Copy link

I have the same issue :(

@nickdaugherty
Copy link

It adds the question mark at the end due to an incorrect check on url.js, line 52. Even if the query string is empty, the check returns true since url parsing returns an object literal, which evaluates to true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants