mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Update isLocal logic to enforce protocol and port (#1737)
This commit is contained in:
parent
9ed387ad26
commit
fb0b7534d7
|
@ -129,8 +129,8 @@ export default class Link extends Component {
|
||||||
function isLocal (href) {
|
function isLocal (href) {
|
||||||
const url = parse(href, false, true)
|
const url = parse(href, false, true)
|
||||||
const origin = parse(getLocationOrigin(), false, true)
|
const origin = parse(getLocationOrigin(), false, true)
|
||||||
return (!url.host || !url.hostname) ||
|
return !url.host ||
|
||||||
(origin.host === url.host || origin.hostname === url.hostname)
|
(url.protocol === origin.protocol && url.host === origin.host)
|
||||||
}
|
}
|
||||||
|
|
||||||
const warnLink = execOnce(warn)
|
const warnLink = execOnce(warn)
|
||||||
|
|
Loading…
Reference in a new issue