Skip to content

Commit e08bd05

Browse files
committed
fix: fix Windows paths
1 parent 64368f0 commit e08bd05

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +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) =>
261-
store.startsWith(platform === 'win32' ? encodeURIComponent(prefix) : prefix),
262-
)
260+
const filteredStores = allStores
261+
.map((store) => (platform === 'win32' ? decodeURIComponent(store) : store))
262+
.filter((store) => store.startsWith(prefix))
263263

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

0 commit comments

Comments
 (0)