mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-03 10:57:18 +00:00
fix(server): allow rendering urls with unicode characters (#4512)
This commit is contained in:
parent
b47a993429
commit
c3128eaced
@ -7,7 +7,7 @@ import { getContext } from '@nuxt/common'
|
|||||||
export default ({ options, nuxt, renderRoute, resources }) => async function nuxtMiddleware(req, res, next) {
|
export default ({ options, nuxt, renderRoute, resources }) => async function nuxtMiddleware(req, res, next) {
|
||||||
// Get context
|
// Get context
|
||||||
const context = getContext(req, res)
|
const context = getContext(req, res)
|
||||||
const url = req.url
|
const url = decodeURI(req.url)
|
||||||
|
|
||||||
res.statusCode = 200
|
res.statusCode = 200
|
||||||
try {
|
try {
|
||||||
|
@ -324,7 +324,8 @@ describe('basic ssr', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('/тест雨 (test non ascii route)', async () => {
|
test('/тест雨 (test non ascii route)', async () => {
|
||||||
const { html } = await nuxt.server.renderRoute('/тест雨')
|
const window = await nuxt.server.renderAndGetWindow(url('/тест雨'))
|
||||||
|
const html = window.document.body.innerHTML
|
||||||
expect(html).toMatch('Hello unicode')
|
expect(html).toMatch('Hello unicode')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user