udpate plugins search-backend-module-catalog encoding the entity property values with encodeURIComponent for location

Signed-off-by: tong min <min.tong.cn@gmail.com>
This commit is contained in:
tong min
2025-01-05 03:28:05 +00:00
parent 41ab5cf4a0
commit eee8d76a4f
2 changed files with 10 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-search-backend-module-catalog': patch
---
Modified the logic for generating the location URL by encoding the entity property values with encodeURIComponent. This enhancement improves the safety and reliability of the URL.
@@ -120,9 +120,11 @@ export class DefaultCatalogCollatorFactory implements DocumentCollatorFactory {
resourceRef: stringifyEntityRef(entity),
},
location: this.applyArgsToFormat(this.locationTemplate, {
namespace: entity.metadata.namespace || 'default',
kind: entity.kind,
name: entity.metadata.name,
namespace: encodeURIComponent(
entity.metadata.namespace || 'default',
),
kind: encodeURIComponent(entity.kind),
name: encodeURIComponent(entity.metadata.name),
}),
};
}