Fix action failures due to state tree encoding (#53655)
fixes #53654 ### Related PRs - #51017
This commit is contained in:
parent
78b04980be
commit
b993afbf7c
2 changed files with 11 additions and 1 deletions
|
@ -52,7 +52,7 @@ async function fetchServerAction(
|
|||
headers: {
|
||||
Accept: RSC_CONTENT_TYPE_HEADER,
|
||||
'Next-Action': actionId,
|
||||
[NEXT_ROUTER_STATE_TREE]: JSON.stringify(state.tree),
|
||||
[NEXT_ROUTER_STATE_TREE]: encodeURIComponent(JSON.stringify(state.tree)),
|
||||
...(process.env.__NEXT_ACTIONS_DEPLOYMENT_ID &&
|
||||
process.env.NEXT_DEPLOYMENT_ID
|
||||
? {
|
||||
|
|
|
@ -393,6 +393,16 @@ createNextDescribe(
|
|||
return newTestCookie !== currentTestCookie ? 'success' : 'failure'
|
||||
}, 'success')
|
||||
})
|
||||
|
||||
it('should handle unicode search params', async () => {
|
||||
const browser = await next.browser('/server?name=名')
|
||||
|
||||
const cnt = await browser.elementByCss('h1').text()
|
||||
expect(cnt).toBe('0')
|
||||
|
||||
await browser.elementByCss('#inc').click()
|
||||
await check(() => browser.elementByCss('h1').text(), '1')
|
||||
})
|
||||
})
|
||||
|
||||
describe('fetch actions', () => {
|
||||
|
|
Loading…
Reference in a new issue