Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 8a332af

Browse files
committed
fix(serve): encode glob returned path.
Close #422.
1 parent 7bda4cb commit 8a332af

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/fs.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ export class LocalFileSystem implements FileSystem {
7878
follow: true,
7979
})
8080
globber.on('match', (file: string) => {
81-
subscriber.next(normalizeUri(base + file))
81+
const encodedPath = file
82+
.split('/')
83+
.map(encodeURIComponent)
84+
.join('/')
85+
subscriber.next(normalizeUri(base + encodedPath))
8286
})
8387
globber.on('error', (err: any) => {
8488
subscriber.error(err)

0 commit comments

Comments
 (0)