mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-17 21:06:14 +00:00
fix(media): keep file-store keys portable
This commit is contained in:
parent
877e9831b9
commit
cf432ec871
1 changed files with 2 additions and 2 deletions
|
|
@ -84,7 +84,7 @@ function resolveMediaSubdir(subdir: string, caller: string): string {
|
|||
if (segments.some((segment) => !segment || segment === "." || segment === "..")) {
|
||||
throw new Error(`${caller}: unsafe media subdir: ${JSON.stringify(subdir)}`);
|
||||
}
|
||||
return path.join(...segments);
|
||||
return path.posix.join(...segments);
|
||||
}
|
||||
|
||||
function resolveMediaScopedDir(subdir: string, caller: string): string {
|
||||
|
|
@ -102,7 +102,7 @@ function resolveMediaRelativePath(id: string, subdir: string, caller: string): s
|
|||
throw new Error(`${caller}: unsafe media ID: ${JSON.stringify(id)}`);
|
||||
}
|
||||
const safeSubdir = resolveMediaSubdir(subdir, caller);
|
||||
return safeSubdir ? path.join(safeSubdir, id) : id;
|
||||
return safeSubdir ? path.posix.join(safeSubdir, id) : id;
|
||||
}
|
||||
|
||||
function openMediaStore(maxBytes = MAX_BYTES, rootDir = resolveMediaDir()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue