Skip to content

Commit

Permalink
Add test for #108
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Apr 25, 2020
1 parent c422c1b commit e69796d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,8 @@ test('data URL', t => {
t.is(normalizeUrl('data:,foo#bar', options), 'data:,foo');
t.is(normalizeUrl('data:,www.sindresorhus.com', options), 'data:,www.sindresorhus.com');
});

test('prevents homograph attack', t => {
// The input string uses Unicode to make it look like a valid `ebay.com` URL.
t.is(normalizeUrl('https://ebаy.com'), 'https://xn--eby-7cd.com');
});

0 comments on commit e69796d

Please sign in to comment.