getlift / lift

Expanding Serverless Framework beyond functions using the AWS CDK
MIT License
912 stars 111 forks source link

Simplify `server-side-website` with the new `AllViewerExceptHostHeader` policy #306

Closed mnapoli closed 1 year ago

mnapoli commented 1 year ago

CloudFront added a new AllViewerExceptHostHeader policy: https://twitter.com/cristiangraz/status/1628585607479050240

This is exactly what we needed!

We can get rid of:

We gain:

If you were setting the forwardedHeader config in serverless.yml to add more headers to forward, you can now safely remove this option:

constructs:
    website:
        # ...

        # REMOVE THIS šŸ‘‡
        forwardedHeaders:
            - Accept
            - Accept-Language
            # ...
            - X-Custom-Header

We also finally solve 100% properly #144

Fixes #144 Fixes #229 Fixes #291 and so many more in bref.sh šŸŽ‰

kevincerro commented 1 year ago

Great news šŸš€

buddhaCode commented 1 year ago

Does this also solve the issue, that u have to name/list all custom headers like X-Livewire and custom headers for CSRF token in Laravel?

Edit: Okay. Saw #306. Thats absolutely great news!

mnapoli commented 1 year ago

@buddhaCode yeeeessss!

esimonetti commented 1 year ago

:heart: thank you!!!!