Validator.js: ftp with path not seen as valid

Created on 25 Jan 2021  路  8Comments  路  Source: validatorjs/validator.js

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

help wanted 馃悰 bug

Most helpful comment

@profnandaa Can I give it a shot ?

All 8 comments

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

@katungi

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

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?

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

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

PR welcome. Thanks @katungi for investigating.

@profnandaa Can I give it a shot ?

@katungi -- for sure, thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

frontendmonster picture frontendmonster  路  4Comments

galki picture galki  路  3Comments

rubiin picture rubiin  路  3Comments

jaxkodex picture jaxkodex  路  3Comments

zilahir picture zilahir  路  3Comments