Skip to content

Dynamic Routes Using encodeURIComponent No Longer Work (SSR) #16781

@rktyt

Description

@rktyt

Astro Info

Astro                    v6.3.5
Node                     v24.11.1
System                   Linux (arm64)
Package Manager          npm
Output                   server
Adapter                  @astrojs/node
Integrations             change-client-filename

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

While testing an upgrade from v6.3.1 to v6.3.5, we found that the changes introduced in #16556 (included in v6.3.2) caused dynamic routes using encodeURIComponent to stop working.

For example, requests such as:

`/uploads/${encodeURIComponent('%?.pdf')}`

no longer reach the handler file:

pages/uploads/[name].ts

The processing flow is as follows:

%25%3F.pdf -> decodeURI -> %%3F.pdf -> MultiLevelEncodingError

What's the expected result?

The request should reach and be handled by the user code.


Related issue: #16313

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-jexn5ssw?file=src%2Fpages%2F%5Bfile%5D.ts

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

Labels

needs triageIssue needs to be triaged

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions