Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 9324178

Browse files
committed
Return POSIX paths from unsanitised FileStorage#list()
1 parent d4de3a6 commit 9324178

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/storage-file/src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,11 @@ export class FileStorage extends LocalStorage {
203203
// Try to get file meta
204204
const meta = await this.meta<Meta>(filePath);
205205
// Get the real unsanitised key if it exists
206-
const realName = meta?.key ?? name;
206+
const realName =
207+
meta?.key ??
208+
// If this is unsanitised storage (e.g. Workers Sites), make sure we
209+
// return POSIX paths
210+
(this.sanitise ? name : name.split(path.sep).join(path.posix.sep));
207211

208212
keys.push({
209213
name: realName,

0 commit comments

Comments
 (0)