stac-server
stac-server copied to clipboard
When prehook is configured, it throws an exception when the api parsing the response from prehook lambda
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))