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

False positives #7

Open
atuttle opened this issue Feb 5, 2015 · 3 comments
Open

False positives #7

atuttle opened this issue Feb 5, 2015 · 3 comments

Comments

@atuttle
Copy link

atuttle commented Feb 5, 2015

var validator = require('valid-url');
console.log( validator.isWebUri('http://foo') );

prints http://foo (e.g. true), which is not correct. There is no TLD. Valid URLs will have at least one dot and 1 character after the dot.

@ogt
Copy link
Owner

ogt commented Feb 5, 2015

Let me check whether this is the behavior of the original perl module or whether it is a bug introduced by me in the "translation". It appears that based on the original spec, the perl module would reject "relative hostnames" as opposed to accept them per RFC, which is the behavior you advocate as well
image

@ogt
Copy link
Owner

ogt commented Feb 5, 2015

So, in summary what you are pointing is a bug. i couldn't find anywhere in the perl code the part that is enforcing what he describes in the spec, ie that the authority is an actual TLD. It may take me a couple days to find the time to fix this. (out of job - trying to start my next company)

@KhodeN
Copy link

KhodeN commented Jun 5, 2017

This is not bug.
It is a valid URL. For example, you can declare 'foo' in /etc/hosts file for localhost or in your local network DNS-server for resolving internal hosts.

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