Merge pull request #1200 from gsd-build/fix/unit-runtime-sanitization

fix: broaden unit-runtime path sanitization
This commit is contained in:
TÂCHES 2026-03-18 11:22:03 -06:00 committed by GitHub
commit 97b7c0b18a

View file

@ -51,8 +51,8 @@ function runtimeDir(basePath: string): string {
}
function runtimePath(basePath: string, unitType: string, unitId: string): string {
const sanitizedUnitType = unitType.replace(/[\/]/g, "-");
const sanitizedUnitId = unitId.replace(/[\/]/g, "-");
const sanitizedUnitType = unitType.replace(/[^a-zA-Z0-9._-]+/g, "-");
const sanitizedUnitId = unitId.replace(/[^a-zA-Z0-9._-]+/g, "-");
return join(runtimeDir(basePath), `${sanitizedUnitType}-${sanitizedUnitId}.json`);
}