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

isURL marks valid URL as invalid #294

Closed
AVVS opened this issue Jun 10, 2014 · 6 comments
Closed

isURL marks valid URL as invalid #294

AVVS opened this issue Jun 10, 2014 · 6 comments

Comments

@AVVS
Copy link
Contributor

AVVS commented Jun 10, 2014

http://mari--mari.ya.ru

.isURL marks this as invalid, though it works just fine

@blakehall
Copy link

isURL() also fails when there is http auth information in the url.

So something like http://username:[email protected] also fails.

@chriso
Copy link
Collaborator

chriso commented Jun 12, 2014

@blakehall auth is supported.

/Volumes/Repositories/personal/validator.js (air) $ node
> var v = require('./');
undefined
> v.isURL('http://username:[email protected]');
true

@chriso chriso closed this as completed in f860503 Jun 13, 2014
@chriso
Copy link
Collaborator

chriso commented Jun 13, 2014

Added in 3.15.0.

@blakehall
Copy link

@chriso Indeed, I mistakenly assumed it was an issue with http auth. It looks like the issue is actually with an underscore in our subdomain.

I'm trying to use this with our custom CI tool, which has urls like pr.example_com.294.example.com.

v.isURL('http://username:[email protected]_com.294.example.com') -> false
v.isURL('http://username:[email protected]') -> true

@chriso
Copy link
Collaborator

chriso commented Jun 13, 2014

@blakehall I just pushed 3.16.0 with support for underscores in subdomains (via an option):

v.isURL('http://pr.example_com.294.example.com', {allow_underscores: true})
// => true

Previous discussion was in #242.

@blakehall
Copy link

cool! thanks for the pointer @chriso!

👍

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

3 participants