Files
vercel__next.js/test/e2e/app-dir/prerender-encoding/prerender-encoding.test.ts
Sam Ko 35a3eca34e fix: uri encode dynamic routes in dev (#71588)
## Why?

In `next dev`, `404` errors are returned for dynamic routes that contain
characters that should be URI encoded in the path. The `404`s are not
present in `next build`.

## How?

We're failing to decode the
[`resolvedUrlPathname`](https://github.com/vercel/next.js/blob/ffec1d3a458056a4531e6b35518fca28bf9c3943/packages/next/src/server/base-server.ts#L2897)
in `next dev`, resulting in a `404`. So we add the same decoding logic
in development.

- Fixes https://github.com/vercel/next.js/issues/63002
2024-10-29 14:51:45 -07:00

13 lines
356 B
TypeScript

import { nextTestSetup } from 'e2e-utils'
describe('prerender-encoding', () => {
const { next } = nextTestSetup({
files: __dirname,
})
it('should respond with the prerendered page correctly', async () => {
const $ = await next.render$('/sticks%20%26%20stones')
expect($('div').text()).toBe('params.id is sticks%20%26%20stones')
})
})