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

Fails to check ftp URLs with username and password #15

Open
codelion opened this issue Jan 6, 2017 · 7 comments
Open

Fails to check ftp URLs with username and password #15

codelion opened this issue Jan 6, 2017 · 7 comments

Comments

@codelion
Copy link

codelion commented Jan 6, 2017

I was trying to test this library with GramTest, a grammar based test case generation tool (https://github.com/codelion/gramtest). I found that it fails to to check ftp URLs.

isUrl('ftp://username:password@hostname') //returns false

@ghost
Copy link

ghost commented Jan 29, 2018

Sorry but the code actually returns true:

https://runkit.com/embed/bpdqcu0ec4nk

@davisjam
Copy link
Contributor

@codelion The current behavior is to return true on the example you provided.

Can you confirm and close this issue, or suggest another failing ftp example?

@codelion codelion changed the title Fails to check ftp URLs Fails to check ftp URLs with username and password Mar 24, 2018
@codelion
Copy link
Author

codelion commented Mar 24, 2018

@davisjam @chmursonss I updated the URL, I think it fails for FTP URLs with username and password.

@villesau
Copy link

villesau commented Sep 12, 2018

@codelion it's because your url is ftp://username:password@hostname. It succeeds if you have any TLD there: ftp://username:password@hostname.com

@codelion
Copy link
Author

@villesau as per the RFC https://www.ietf.org/rfc/rfc1738.txt host name doesn’t have to end with a TLD.

hostname = *[ domainlabel "." ] toplabel
domainlabel = alphadigit | alphadigit *[ alphadigit | "-" ] alphadigit
toplabel = alpha | alpha *[ alphadigit | "-" ] alphadigit

@riker09
Copy link

riker09 commented Sep 27, 2018

This seems to be an invalid URL: amqp://user:pass@domain.tld:1234

The port is what throws the regex off, the rest matches just fine.

@sloops77
Copy link

sloops77 commented Oct 9, 2018

I also get this failure for a url like 'postgresql://user:pass@localhost:5432/dev'. without a user/pass it passes

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