mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-02 04:53:17 +00:00
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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user