mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
35a3eca34e
## 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
13 lines
356 B
TypeScript
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')
|
|
})
|
|
})
|