Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions test/validators.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,11 @@ describe('Validators', () => {
}],
valid: [
'rtmp://foobar.com',
'rtmp:foobar.com',
],
invalid: [
'http://foobar.com',
'tel:+15551234567',
],
});
});
Expand Down Expand Up @@ -722,6 +724,21 @@ describe('Validators', () => {
});
});

it('should validate authentication strings if a protocol is not required', () => {
test({
validator: 'isURL',
args: [{
require_protocol: false,
}],
valid: [
'user:[email protected]/',
],
invalid: [
'user:pw,@foobar.com/',
],
});
});

it('should let users specify a host whitelist', () => {
test({
validator: 'isURL',
Expand Down