dherault / serverless-offline

Emulate AWS λ and API Gateway locally when developing your Serverless project
MIT License
5.16k stars 794 forks source link

fix: Support ALB Event response headers #1756

Closed corwinm closed 1 month ago

corwinm commented 5 months ago

Description

Motivation and Context

This PR adds support for ALB Event handlers to return headers. This enables different "Content-Type" or "Set-Cookie" headers.

Fixes #1728

How Has This Been Tested?

Examples were added to manually test as well as integration tests added.

Screenshots (if appropriate):

tristanl-slalom commented 5 months ago

This looks great. This would help us with a solution based on ALB where we need to return redirect and cookies for our web app. Our work around for this is just to deploy the functions and test there, which is really sluggish for us!

dnalborczyk commented 5 months ago

thank you for the PR @corwinm ! could you run npm run prettier:fix over the changes?

I'll have a look over your PR in the next coming days.

corwinm commented 4 months ago

Sorry @dnalborczyk, I meant to comment back. I ran prettier and updated the PR. Turns out I needed to configure my prettier plugin to run on yaml (or just use the script before committing). Anything else I can do to help here?