jetbridge / cdk-nextjs

Deploy a NextJS application using AWS CDK
https://constructs.dev/packages/cdk-nextjs-standalone
Apache License 2.0
273 stars 45 forks source link

Authorization header is dropped by lambda@edge signing function when FunctionUrlAuthType.AWS_IAM is used #214

Closed nathanchildressporsche closed 4 months ago

nathanchildressporsche commented 4 months ago

The signing function used for authenticating the secure lambda function urls adds an authorization header. In the current implementation, this will override any authorization header forwarded from CloudFront behaviors.

A potential solution to this would be mapping the existing authorization header to a new header before overwriting it with the AWS authorization header. This would allow clients to still use an authorization header in requests, while the nextjs function could read from the re-mapped header value.

bestickley commented 4 months ago

Thank you, @nathanchildressporsche!