Unescape the locationsFoundAt paths
This commit is contained in:
@@ -154,7 +154,9 @@ export default class ComponentDetection {
|
|||||||
packages.forEach((pkg: ComponentDetectionPackage) => {
|
packages.forEach((pkg: ComponentDetectionPackage) => {
|
||||||
pkg.locationsFoundAt.forEach((location: any) => {
|
pkg.locationsFoundAt.forEach((location: any) => {
|
||||||
// Use the normalized path (remove leading slash if present)
|
// Use the normalized path (remove leading slash if present)
|
||||||
const normalizedLocation = location.startsWith('/') ? location.substring(1) : location;
|
let normalizedLocation = location.startsWith('/') ? location.substring(1) : location;
|
||||||
|
// Unescape the path, as upstream ComponentDetection emits locationsFoundAt in URL-encoded form
|
||||||
|
normalizedLocation = decodeURIComponent(normalizedLocation);
|
||||||
|
|
||||||
if (!manifests.find((manifest: Manifest) => manifest.name == normalizedLocation)) {
|
if (!manifests.find((manifest: Manifest) => manifest.name == normalizedLocation)) {
|
||||||
const manifest = new Manifest(normalizedLocation, normalizedLocation);
|
const manifest = new Manifest(normalizedLocation, normalizedLocation);
|
||||||
|
|||||||
Reference in New Issue
Block a user