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 }