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 allow_protocol_relative_urls intended behavior? #860

Closed
linkenneth opened this issue Jul 4, 2018 · 1 comment
Closed

isURL allow_protocol_relative_urls intended behavior? #860

linkenneth opened this issue Jul 4, 2018 · 1 comment
Labels

Comments

@linkenneth
Copy link

linkenneth commented Jul 4, 2018

What is the intended effect of allow_protocol_relative_urls? It seems to me that there might be a bug, but I'm also not clear on the flag's intended effects. For example:

> isURL('//google.com/login', {require_host: false}) // default allow_protocol_relative_urls: false
true

The source just seems to offset the rest of the parsing by the protocol, and there doesn't seem to be any way that explicitly fails when protocol-relative URLs are used.

https://github.com/chriso/validator.js/blob/master/lib/isURL.js#L86

@chriso
Copy link
Collaborator

chriso commented Jul 31, 2018

Thanks, that is indeed a bug.

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

No branches or pull requests

2 participants