Commit fb0b7534 authored by Kuan's avatar Kuan Committed by Tim Neutkens

Update isLocal logic to enforce protocol and port (#1737)

parent 9ed387ad
......@@ -129,8 +129,8 @@ export default class Link extends Component {
function isLocal (href) {
const url = parse(href, false, true)
const origin = parse(getLocationOrigin(), false, true)
return (!url.host || !url.hostname) ||
(origin.host === url.host || origin.hostname === url.hostname)
return !url.host ||
(url.protocol === origin.protocol && url.host === origin.host)
}
const warnLink = execOnce(warn)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment