validator.js
validator.js copied to clipboard
URL protocols limited to ftp, http, https - does not accept rtmp
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.
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
:+1: Thanks for getting this in.