Skip to content

Commit 64368f0

Browse files
committed
fix: encode directory for Windows
1 parent 50cb071 commit 64368f0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/server.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,9 @@ export class BlobsServer {
257257
async listStores(req: http.IncomingMessage, res: http.ServerResponse, rootPath: string, prefix: string) {
258258
try {
259259
const allStores = await fs.readdir(rootPath)
260-
const filteredStores = allStores.filter((store) => store.startsWith(prefix))
260+
const filteredStores = allStores.filter((store) =>
261+
store.startsWith(platform === 'win32' ? encodeURIComponent(prefix) : prefix),
262+
)
261263

262264
return this.sendResponse(req, res, 200, JSON.stringify({ stores: filteredStores }))
263265
} catch (error) {

0 commit comments

Comments
 (0)