Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] AWS Lambda handler hardcodes ServerOptions #4064

Closed
cakper opened this issue Sep 25, 2024 · 1 comment · Fixed by #4223
Closed

[BUG] AWS Lambda handler hardcodes ServerOptions #4064

cakper opened this issue Sep 25, 2024 · 1 comment · Fixed by #4223

Comments

@cakper
Copy link

cakper commented Sep 25, 2024

Tapir version: latest in master

Scala version: 3.5.1

Hello,

I was trying to configure CORS for lambda handler and couldn't get it to work by overriding serverOptions when extending AwsLambdaIORuntime. I believe the issue is that in LambdaHandler when process is called, then default no encoding options are used: https://github.com/softwaremill/tapir/blob/master/serverless/aws/lambda-cats-effect/src/main/scala/sttp/tapir/serverless/aws/lambda/LambdaHandler.scala#L28

How to reproduce?

Create AwsLambdaIORuntime and pass any interceptor to it, run the code - it doesn't get called.


I might give fixing it a go, if I get a bit of guidance at to what solution you would prefer

@adamw
Copy link
Member

adamw commented Sep 25, 2024

Indeed that's a bug. I think following what other interpreters do, that is - allow defining custom server options and using those - is what we should be after. If you could work on a PR, that would be great :)

sergiuszkierat added a commit that referenced this issue Dec 24, 2024
*Why I did it?*
LambdaHandler had the hardcoded AwsServerOptions, so delivering
the custom server options was impossible.

*How I did it:*
LambdaHandler started to accept options by analogous to ZioLambdaHandler

Closes #4064
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants