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:
parent
e88ea2c7cf
commit
a84e934d21
2 changed files with 6 additions and 1 deletions
5
.changeset/shaggy-gifts-beg.md
Normal file
5
.changeset/shaggy-gifts-beg.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@astrojs/node': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix incorrent encoded when path has other language characters
|
|
@ -19,7 +19,7 @@ export function createServer(
|
||||||
if (req.url) {
|
if (req.url) {
|
||||||
let pathname = removeBase(req.url);
|
let pathname = removeBase(req.url);
|
||||||
pathname = pathname[0] === '/' ? pathname : '/' + pathname;
|
pathname = pathname[0] === '/' ? pathname : '/' + pathname;
|
||||||
const stream = send(req, encodeURI(pathname), {
|
const stream = send(req, encodeURI(decodeURI(pathname)), {
|
||||||
root: fileURLToPath(client),
|
root: fileURLToPath(client),
|
||||||
dotfiles: pathname.startsWith('/.well-known/') ? 'allow' : 'deny',
|
dotfiles: pathname.startsWith('/.well-known/') ? 'allow' : 'deny',
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue