Skip to content

Commit fb0b753

Browse files
khankuantimneutkens
authored andcommitted
Update isLocal logic to enforce protocol and port (vercel#1737)
1 parent 9ed387a commit fb0b753

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/link.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ export default class Link extends Component {
129129
function isLocal (href) {
130130
const url = parse(href, false, true)
131131
const origin = parse(getLocationOrigin(), false, true)
132-
return (!url.host || !url.hostname) ||
133-
(origin.host === url.host || origin.hostname === url.hostname)
132+
return !url.host ||
133+
(url.protocol === origin.protocol && url.host === origin.host)
134134
}
135135

136136
const warnLink = execOnce(warn)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy