Skip to content

Commit

Permalink
Don't allow comma in the scheme (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
andybelltree authored and sindresorhus committed Sep 13, 2019
1 parent d7b4881 commit 6fcdcd1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ module.exports = url => {

// Scheme: https://tools.ietf.org/html/rfc3986#section-3.1
// Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3
return /^[a-z][a-z\d+-.]*:/.test(url);
return /^[a-z][a-z\d+\-.]*:/.test(url);
};
1 change: 1 addition & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ test('main', t => {
t.false(isAbsoluteUrl('c:\\'));
t.false(isAbsoluteUrl('c:\\Dev\\test-broken'));
t.false(isAbsoluteUrl('C:\\Dev\\test-broken'));
t.false(isAbsoluteUrl('ht,tp://sindresorhus.com'));
});

0 comments on commit 6fcdcd1

Please sign in to comment.