import { CloudFrontResponseHandler } from "aws-lambda" ; import { getConfigWithHeaders } from "../shared/shared" ; const CONFIG = getConfigWithHeaders ( ) ; CONFIG . logger . debug ( "Configuration loaded:" , CONFIG ) ; export const handler = async ( event ) => { CONFIG . logger . debug ( "Event:" , event ) ; const response = event . Records [ 0 ] . cf . response ; Object . assign ( response . headers , CONFIG . cloudFrontHeaders ) ; CONFIG . logger . debug ( "Returning response:\n" , response ) ; return response ; } ;