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

validateURL is not nice function #23

Closed
YaroslavGaponov opened this issue Aug 13, 2014 · 5 comments
Closed

validateURL is not nice function #23

YaroslavGaponov opened this issue Aug 13, 2014 · 5 comments

Comments

@YaroslavGaponov
Copy link

I mean it possible problems for local hostname like http://myworknotebook etc

@alexlangberg
Copy link

Yup. To add to this, it would at least be handy for the error to indicate which of the potentially hundreds of links is invalid. It would be nice to change it to this:

if(!validateURL(entries[i].link))
  throw new Error('invalid entry link');

... to this:

if(!validateURL(entries[i].link))
  throw new Error('invalid entry link: ' + entries[i].link);

@alexlangberg
Copy link

It also seems to fail, even on valid urls such as:

https://foo.com/bar/?baz=bax

A suggestion could be to use the validator module:

https://www.npmjs.com/package/validator

Or pick up their version of url validation:

https://github.com/chriso/validator.js/blob/master/validator.js#L200-L260

@goodseller
Copy link

+1

@ArtskydJ
Copy link
Contributor

Fixed in 761272c?

@jpmonette
Copy link
Owner

Removed validation on URL - developer is free to write them valid.

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