This commit is contained in:
Devin Binnie 2022-01-20 15:25:34 -05:00
parent c98b10c35c
commit dc18a48727
2 changed files with 10 additions and 2 deletions

View file

@ -247,7 +247,15 @@ function isCustomLoginURL(url: URL | string, server: ServerFromURL, teams: TeamW
}
function isChannelExportUrl(serverUrl: URL | string, inputUrl: URL | string): boolean {
return isUrlType('plugins/com.mattermost.plugin-channel-export/api/v1/export', serverUrl, inputUrl);
const server = getServerInfo(serverUrl);
const parsedURL = parseURL(inputUrl);
if (!parsedURL || !server) {
return false;
}
return (
equalUrlsIgnoringSubpath(server.url, parsedURL) &&
(parsedURL.pathname.toLowerCase().startsWith(`${server.subpath}plugins/com.mattermost.plugin-channel-export/api/v1/export/`) ||
parsedURL.pathname.toLowerCase().startsWith('/plugins/com.mattermost.plugin-channel-export/api/v1/export/')));
}
export default {

View file

@ -49,7 +49,7 @@ const generateWillNavigate = (getServersFunction: () => TeamWithTabs[]) => {
if (server && (urlUtils.isTeamUrl(server.url, parsedURL) || urlUtils.isAdminUrl(server.url, parsedURL) || isTrustedPopupWindow(event.sender))) {
return;
}
if (server && urlUtils.isChannelExportUrl(server.url, parsedURL)) {
return;
}