Skip to content

Commit

Permalink
Fix incorrent encoded when path has other language characters (#6088)
Browse files Browse the repository at this point in the history
* fix: Incorrent encoded when path has Chinese

* chore: exec changeset
  • Loading branch information
QingXia-Ela authored Feb 1, 2023
1 parent f05eb9f commit 6a03649
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/shaggy-gifts-beg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/node': patch
---

fix incorrent encoded when path has other language characters
2 changes: 1 addition & 1 deletion packages/integrations/node/src/http-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
});
Expand Down

0 comments on commit 6a03649

Please sign in to comment.