Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite committed Sep 4, 2024
1 parent 43b54f4 commit 1311f64
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plugin-server/src/cdp/hog-executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 1311f64

Please sign in to comment.