🐛 Fixed referrals to web archive

no refs
-removed ref param for archive.org domain
-ref links to archive.org were broken
This commit is contained in:
Steve Larson 2023-03-07 13:35:34 -06:00
parent f6280d835d
commit c111f8bef4
2 changed files with 8 additions and 1 deletions

View File

@ -4,7 +4,9 @@ const LinkReplacer = require('@tryghost/link-replacer');
const blockedReferrerDomains = [
// Facebook has some restrictions on the 'ref' attribute (max 15 chars + restricted character set) that breaks links if we add ?ref=longer-string
'facebook.com',
'www.facebook.com'
'www.facebook.com',
'web.archive.org',
'archive.org'
];
/**

View File

@ -82,6 +82,11 @@ describe('OutboundLinkTagger', function () {
const updatedUrl = await service.addToUrl(url);
should(updatedUrl.toString()).equal('https://facebook.com/');
const urlTwo = new URL('https://web.archive.org/');
const updatedUrlTwo = await service.addToUrl(urlTwo);
should(updatedUrlTwo.toString()).equal('https://web.archive.org/');
});
it('does not add ref if utm_source is present', async function () {