diff --git a/packages/server/src/middleware/nuxt.js b/packages/server/src/middleware/nuxt.js index 628e234fb8..a743222aba 100644 --- a/packages/server/src/middleware/nuxt.js +++ b/packages/server/src/middleware/nuxt.js @@ -7,7 +7,7 @@ import { getContext } from '@nuxt/common' export default ({ options, nuxt, renderRoute, resources }) => async function nuxtMiddleware(req, res, next) { // Get context const context = getContext(req, res) - const url = req.url + const url = decodeURI(req.url) res.statusCode = 200 try { diff --git a/test/unit/basic.ssr.test.js b/test/unit/basic.ssr.test.js index cad81ab9a4..a04f74643e 100644 --- a/test/unit/basic.ssr.test.js +++ b/test/unit/basic.ssr.test.js @@ -324,7 +324,8 @@ describe('basic ssr', () => { }) 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') })