-
Notifications
You must be signed in to change notification settings - Fork 490
Closed
Labels
bugThis issue is a bug.This issue is a bug.module/aspnetcore-supportp2This is a standard priority issueThis is a standard priority issuequeued
Description
Description
When following the description to create a Minimal API with Amazon.Lambda.AspNetCoreServer.Hosting and added FastEndpoints, the response Dto is sent twice.
Reproduction Steps
Program.cs attached, created using serverless.AspNetCoreWebAPI project template and add a nuget package called FastEndpoints. Build and Publish to Lambda in Visual Studios 2022. Post payload as:
curl --location --request POST 'https://xxxxx.execute-api.ap-northeast-1.amazonaws.com/Prod/api/author' \
--header 'Content-Type: application/json' \
--data-raw '{
"firstName": "John",
"lastName": "Doe",
"age": 16
}'
Response returned:
{
"fullName": "John Doe",
"isOver18": false
}{
"fullName": "John Doe",
"isOver18": false
}
Logs
screenshot attached.
Environment
- Build Version:
- Amazon.Lambda.AspNetCoreServer.Hosting 1.0.0
- FastEndpoints 3.9.1
- OS Info: Local Dev: Windows 10 | Lambda runtime: dotnet6 on AmazonLinux 2
- Build Environment: Visual Studio Community 2022
- Targeted .NET Platform: net6.0 (6.0.200)
Resolution
- 👋 I can/would-like-to implement a fix for this problem myself
It seems that Amazon.Lambda.AspNetCoreServer did not set the HasStarted property of the IHttpResponseFeature which the HttpContext reads from.
This is a 🐛 bug-report
Program.cs.txt
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.module/aspnetcore-supportp2This is a standard priority issueThis is a standard priority issuequeued