Skip to content

Commit 20b5212

Browse files
authored
Use Buffer.from().toString() instead of atob() to decode task payload (#8836) (#8843)
1 parent 294c81d commit 20b5212

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/emulator/tasksEmulator.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,9 @@ export class TasksEmulator implements EmulatorInstance {
268268
req.body.task.name =
269269
req.body.task.name ??
270270
`/projects/${projectId}/locations/${locationId}/queues/${queueName}/tasks/${Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)}`;
271-
req.body.task.httpRequest.body = JSON.parse(atob(req.body.task.httpRequest.body));
271+
req.body.task.httpRequest.body = JSON.parse(
272+
Buffer.from(req.body.task.httpRequest.body, "base64").toString("utf-8"),
273+
);
272274

273275
const task = req.body.task as Task;
274276

0 commit comments

Comments
 (0)