Skip to content

Commit

Permalink
refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
shuding committed Mar 17, 2024
1 parent bbd3543 commit 3766a59
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/next/src/server/app-render/action-encryption.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ async function decodeActionBoundArg(actionId: string, arg: string) {
const originalPayload = atob(arg)
const ivValue = originalPayload.slice(0, 16)
const payload = originalPayload.slice(16)
if (payload === undefined) {
throw new Error('Invalid Server Action payload.')
}

const decrypted = textDecoder.decode(
await decrypt(key, stringToUint8Array(ivValue), stringToUint8Array(payload))
Expand Down Expand Up @@ -104,7 +101,7 @@ export async function decryptActionBoundArgs(
const deserialized = await createFromReadableStream(
new ReadableStream({
start(controller) {
controller.enqueue(new TextEncoder().encode(decryped))
controller.enqueue(textEncoder.encode(decryped))
controller.close()
},
}),
Expand Down

0 comments on commit 3766a59

Please sign in to comment.