From 39f3df5b8f301036015704d6b242155e4e6c6eca Mon Sep 17 00:00:00 2001 From: James Steele Date: Sat, 10 Sep 2016 13:33:15 +0100 Subject: [PATCH] Restrict internal links to the same host only A zulip service is hosted with a particular hostname and not across a whole domain. Internal links should respect this otherwise links to other distinct services hosted under the same domain will be loaded by the app and not in a separate browser window. --- app/main/link-helper.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/main/link-helper.js b/app/main/link-helper.js index f2a82559..f11cf9d5 100644 --- a/app/main/link-helper.js +++ b/app/main/link-helper.js @@ -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; }