The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/app/utils/client/getURL.ts

25 lines
754 B

import { settings } from '../../../client/lib/settings';
import { getURLWithoutSettings } from '../lib/getURL';
import { Info } from '../rocketchat.info';
export const getURL = function (
path: string, // eslint-disable-next-line @typescript-eslint/naming-convention
params: {
cdn?: boolean;
full?: boolean;
cloud?: boolean;
cloud_route?: string;
cloud_params?: Record<string, string>;
} = {},
cloudDeepLinkUrl?: string,
cacheKey?: boolean,
): string {
const cdnPrefix = settings.watch('CDN_PREFIX') || '';
const siteUrl = settings.watch('Site_Url') || '';
if (cacheKey) {
path += `${path.includes('?') ? '&' : '?'}cacheKey=${Info.version}`;
}
return getURLWithoutSettings(path, params, cdnPrefix, siteUrl, cloudDeepLinkUrl);
};