Fix incorrent encoded when path has other language characters (#6088)

* fix: Incorrent encoded when path has Chinese

* chore: exec changeset
This commit is contained in:
Shiina 2023-02-02 02:53:09 +08:00 committed by GitHub
parent f05eb9f8ba
commit 6a03649f00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'@astrojs/node': patch
---
fix incorrent encoded when path has other language characters

View file

@ -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',
});