mirror of
https://github.com/nasa/openmct.git
synced 2025-06-12 20:28:14 +00:00
[Representation] Trust template URLs
Trust resource URLs to skip SCE-checking (which profiling flags as a performance problem) for mct-include and mct-representation; these URLs are pulled from bundles and not user-entered, so should be trusted. WTD-1256.
This commit is contained in:
@ -53,17 +53,17 @@ define(
|
||||
* @param {TemplateDefinition[]} templates an array of
|
||||
* template extensions
|
||||
*/
|
||||
function MCTInclude(templates) {
|
||||
function MCTInclude(templates, $sce) {
|
||||
var templateMap = {};
|
||||
|
||||
// Prepopulate templateMap for easy look up by key
|
||||
templates.forEach(function (template) {
|
||||
var key = template.key,
|
||||
path = [
|
||||
path = $sce.trustAsResourceUrl([
|
||||
template.bundle.path,
|
||||
template.bundle.resources,
|
||||
template.templateUrl
|
||||
].join("/");
|
||||
].join("/"));
|
||||
// First found should win (priority ordering)
|
||||
templateMap[key] = templateMap[key] || path;
|
||||
});
|
||||
@ -91,4 +91,4 @@ define(
|
||||
|
||||
return MCTInclude;
|
||||
}
|
||||
);
|
||||
);
|
||||
|
Reference in New Issue
Block a user