4 ms·
Can I ask how you're injecting dynamic content in served html files? My understanding was that lambda@edge functions could not modify the origin response body.
by nihakue 5y ago
Can I ask how you're injecting dynamic content in served html files? My understanding was that lambda@edge functions could not modify the origin response body.
> When you’re working with the HTTP response, Lambda@Edge does not expose the body that is returned by the origin server to the origin-response trigger. You can generate a static content body by setting it to the desired value, or remove the body inside the function by setting the value to be empty. If you don’t update the body field in your function, the original body returned by the origin server is returned back to viewer.
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-updating-http-responses.html https://docs.aws.amazon.com/AmazonCloudFront/latest/Develope...
- heyoni 5y agoIt sounds to me like they might be creating the response from scratch rather than modifying an existing one. And since they’re talking about serving data from s3, maybe it’s just a nicely formatted version of aws s3 ls?
- gehen88 5y agoWe use S3.getObject to fetch it and create a custom response.