From 9142368f4915ec4d1b2065bf9e9828051b510e39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=ED=98=95=EC=84=9D=28Hyungsuk=20Choi=29/FE?= =?UTF-8?q?=EA=B0=9C=EB=B0=9C2=ED=8C=80/11ST?= <13choi13@sk.com> Date: Fri, 25 Sep 2020 23:47:30 +0900 Subject: [PATCH] Cheking urls considering protocol-relative url --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 501061ec..9147d9fa 100644 --- a/src/index.js +++ b/src/index.js @@ -82,7 +82,7 @@ function routeFromLink(node) { target = node.getAttribute('target'); // ignore links with targets and non-path URLs - if (!href || !href.match(/^\//g) || (target && !target.match(/^_?self$/i))) return; + if (!href || !href.match(/^\/(?!\/)/g) || (target && !target.match(/^_?self$/i))) return; // attempt to route, if no match simply cede control to browser return route(href);