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

ftp with path not seen as valid #1584

Closed
Lehren opened this issue Jan 25, 2021 · 10 comments
Closed

ftp with path not seen as valid #1584

Lehren opened this issue Jan 25, 2021 · 10 comments

Comments

@Lehren
Copy link

Lehren commented Jan 25, 2021

Describe the bug
A url like this:
sftp://user:[email protected]:/incoming/things.csv

Is not seen as valid. It is because of the colon character where the filepath starts.

Additional context
Validator.js version: 13.5.2
Node.js version: v.8.17.0
OS platform: [windows, linux, macOS, etc]: macOS 10.15.7

@katungi
Copy link

katungi commented Jan 31, 2021

Hi @Lehren , Just a question. What options are you passing in isURL ?
That will help in recreating the error

@Lehren
Copy link
Author

Lehren commented Jan 31, 2021

@katungi

{
  require_tld: false,
  protocols: ['sftp', 'ftp']
}

@katungi
Copy link

katungi commented Feb 1, 2021

Hello @Lehren. on using isURL, with those options, the check brings back false. How did you make it work on your side?
You mentioned something about the colon, does removing it make it valid?

@Lehren
Copy link
Author

Lehren commented Feb 1, 2021

Yes removing the colon before /incoming/things.csv makes the check return true.

@katungi
Copy link

katungi commented Feb 3, 2021

@Lehren. Yeah, I that actually works. That must be a problem with the isURL validator

@profnandaa
Copy link
Member

PR welcome. Thanks @katungi for investigating.

@katungi
Copy link

katungi commented Apr 18, 2021

@profnandaa Can I give it a shot ?

@profnandaa
Copy link
Member

@katungi -- for sure, thanks!

@MatteoPierro
Copy link
Contributor

Do you mind If I take care of this?

@pano9000
Copy link
Contributor

pano9000 commented Sep 5, 2024

merged with #1751

@pano9000 pano9000 closed this as completed Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants