validator.js icon indicating copy to clipboard operation
validator.js copied to clipboard

URL protocols limited to ftp, http, https - does not accept rtmp

Open severin2 opened this issue 12 years ago • 2 comments

Hello sirs and madams,

Our team recently used validator to check rtmp streaming urls, though validator.js clearly only recognizes (?:https?|ftp) as valid url protocols. There are many more.

severin2 avatar Feb 20 '14 19:02 severin2

The isURL validator now accepts an optional options object which allows you to set the whitelisted protocols

var validator = require('validator');

validator.isURL('rtmp://foobar.com', { protocols: ['rtmp'] }); // => true

chriso avatar Feb 22 '14 02:02 chriso

:+1: Thanks for getting this in.

nickarnold avatar Feb 22 '14 19:02 nickarnold