diff --git a/.changeset/shaggy-gifts-beg.md b/.changeset/shaggy-gifts-beg.md new file mode 100644 index 000000000000..cda46e047c6c --- /dev/null +++ b/.changeset/shaggy-gifts-beg.md @@ -0,0 +1,5 @@ +--- +'@astrojs/node': patch +--- + +fix incorrent encoded when path has other language characters diff --git a/packages/integrations/node/src/http-server.ts b/packages/integrations/node/src/http-server.ts index 19e33c84a68c..8eea3c170e80 100644 --- a/packages/integrations/node/src/http-server.ts +++ b/packages/integrations/node/src/http-server.ts @@ -19,7 +19,7 @@ export function createServer( if (req.url) { let pathname = removeBase(req.url); pathname = pathname[0] === '/' ? pathname : '/' + pathname; - const stream = send(req, encodeURI(pathname), { + const stream = send(req, encodeURI(decodeURI(pathname)), { root: fileURLToPath(client), dotfiles: pathname.startsWith('/.well-known/') ? 'allow' : 'deny', });