Fix node standalone for windows system (#5207)

This commit is contained in:
BeanWei 2022-10-27 17:17:38 +08:00 committed by GitHub
parent 6e417a9636
commit c203a5cc2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View file

@ -0,0 +1,5 @@
---
'@astrojs/node': patch
---
fix static server path for windows system

View file

@ -16,10 +16,9 @@ export function createServer(
) {
const listener: http.RequestListener = (req, res) => {
if (req.url) {
const fileURL = new URL('.' + req.url, client);
const stream = send(req, fileURLToPath(fileURL), {
dotfiles: 'deny',
const stream = send(req, encodeURI(req.url), {
root: fileURLToPath(client),
dotfiles: "deny"
});
let forwardError = false;