Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/impression.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const TRUSTED_REFERRER_HOSTS = [
* Twitter's link wrapper domains:
* - t.co
*/
/^t.co$/,
/^t\.co$/,
];

/**
Expand Down
6 changes: 6 additions & 0 deletions test/unit/test-impression.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,5 +481,11 @@ describes.realWin('impression', {amp: true}, (env) => {
test('https://t.com/asdf', false);
test('https://t.cn/asdf', false);
});

it('should not trust lookalike hosts that match an unescaped dot', () => {
test('https://taco/asdf', false);
test('https://txco/asdf', false);
test('https://t-co/asdf', false);
});
});
});