Merge pull request #70 from steele/host-not-domain

Restrict internal links to the same host only, not all hosts in a domain
This commit is contained in:
Akash Nimare
2016-09-11 02:54:25 +05:30
committed by GitHub

View File

@@ -2,8 +2,8 @@ const wurl = require('wurl');
// Check link if it's internal/external
function linkIsInternal(currentUrl, newUrl) {
const currentDomain = wurl('domain', currentUrl);
const newDomain = wurl('domain', newUrl);
const currentDomain = wurl('hostname', currentUrl);
const newDomain = wurl('hostname', newUrl);
return currentDomain === newDomain;
}