stac-server icon indicating copy to clipboard operation
stac-server copied to clipboard

When prehook is configured, it throws an exception when the api parsing the response from prehook lambda

Open williamsia opened this issue 9 months ago • 1 comments

There was an release last year that bump the version of aws sdk from version 2 to 3. But in version 3 the lambda response payload is now unit8array (look at the discussion here) , so we need to convert the response before doing JSON.parse()

.e.g.

import { toUtf8 } from '@aws-sdk/util-utf8-node';

const rawHookResult = JSON.parse(toUtf8(invocationResponse.Payload))

williamsia avatar May 17 '24 08:05 williamsia