From 1311f64b439ce3e99f680e88f4f014f9bede7120 Mon Sep 17 00:00:00 2001 From: Ben White Date: Wed, 4 Sep 2024 17:53:58 +0200 Subject: [PATCH] Fix --- plugin-server/src/cdp/hog-executor.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugin-server/src/cdp/hog-executor.ts b/plugin-server/src/cdp/hog-executor.ts index 3ecb3830cd724..a1e17cdce5fe2 100644 --- a/plugin-server/src/cdp/hog-executor.ts +++ b/plugin-server/src/cdp/hog-executor.ts @@ -159,9 +159,10 @@ export class HogExecutor { error, timings = [], } = invocation.queueParameters as HogFunctionQueueParametersFetchResponse + let responseBody: any = undefined if (response) { // Convert from buffer to string - response.body = invocation.queueBlob ? Buffer.from(invocation.queueBlob).toString() : undefined + responseBody = invocation.queueBlob ? Buffer.from(invocation.queueBlob).toString() : undefined } // Reset the queue parameters to be sure @@ -189,9 +190,9 @@ export class HogExecutor { throw new Error(error) } - if (typeof response?.body === 'string') { + if (typeof responseBody === 'string') { try { - response.body = JSON.parse(response.body) + responseBody = JSON.parse(responseBody) } catch (e) { // pass - if it isn't json we just pass it on }