Skip to content

Commit

Permalink
fix(server): allow rendering urls with unicode characters (#4512)
Browse files Browse the repository at this point in the history
  • Loading branch information
aldarund authored and clarkdo committed Dec 10, 2018
1 parent b47a993 commit c3128ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/server/src/middleware/nuxt.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion test/unit/basic.ssr.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})

Expand Down

0 comments on commit c3128ea

Please sign in to comment.