Skip to content

Commit 90cc859

Browse files
authored
Update pathProxy.ts
fix:预览包含中文字符命名的html文件,无法正常预览
1 parent c829d74 commit 90cc859

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node/routes/pathProxy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const getProxyTarget = (req: Request, passthroughPath?: boolean): string => {
1111
return `http://0.0.0.0:${req.params.port}/${req.originalUrl}`
1212
}
1313
const query = qs.stringify(req.query)
14-
return `http://0.0.0.0:${req.params.port}/${req.params[0] || ""}${query ? `?${query}` : ""}`
14+
return encodeURI(`http://0.0.0.0:${req.params.port}${req.params[0] || ""}${query ? `?${query}` : ""}`);
1515
}
1616

1717
export async function proxy(

0 commit comments

Comments
 (0)