-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent double uri decoding #9532
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'astro': patch | ||
--- | ||
|
||
Prevents unnecessary URI decoding when rendering a route |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -37,7 +37,7 @@ export async function handleRequest({ | |||||
if (config.trailingSlash === 'never' && !incomingRequest.url) { | ||||||
pathname = ''; | ||||||
} else { | ||||||
pathname = decodeURI(url.pathname); | ||||||
pathname = url.pathname; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It doesn't look like we need to decode it here. It also doesn't work well with the line below: astro/packages/astro/src/vite-plugin-astro-server/request.ts Lines 43 to 44 in cf993bc
(URLs are always encoded) Removing this |
||||||
} | ||||||
|
||||||
// Add config.base back to url before passing it to SSR | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This
getParams
function is being called atastro/packages/astro/src/core/render/params-and-props.ts
Lines 63 to 72 in cf993bc
As shown, it already calls
decodeURIComponent
, so we don't have to calldecodeURIComponent
here too.