Merge pull request #28365 from amintong/master
search-catalog add encodeURIComponent for location
This commit is contained in:
@@ -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.
|
||||
+5
-3
@@ -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),
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user