diff --git a/.autover/changes/pr2150-reset-stream-position.json b/.autover/changes/pr2150-reset-stream-position.json new file mode 100644 index 000000000..a993e5c9b --- /dev/null +++ b/.autover/changes/pr2150-reset-stream-position.json @@ -0,0 +1,11 @@ +{ + "Projects": [ + { + "Name": "Amazon.Lambda.AspNetCoreServer", + "Type": "Patch", + "ChangelogMessages": [ + "Reset the response body stream position to 0 after converting the ASP.NET Core response body to the Lambda response." + ] + } + ] +} diff --git a/Libraries/src/Amazon.Lambda.AspNetCoreServer/APIGatewayHttpApiV2ProxyFunction.cs b/Libraries/src/Amazon.Lambda.AspNetCoreServer/APIGatewayHttpApiV2ProxyFunction.cs index a7bcd519d..debca2025 100644 --- a/Libraries/src/Amazon.Lambda.AspNetCoreServer/APIGatewayHttpApiV2ProxyFunction.cs +++ b/Libraries/src/Amazon.Lambda.AspNetCoreServer/APIGatewayHttpApiV2ProxyFunction.cs @@ -257,7 +257,7 @@ protected override APIGatewayHttpApiV2ProxyResponse MarshallResponse(IHttpRespon } (response.Body, response.IsBase64Encoded) = Utilities.ConvertAspNetCoreBodyToLambdaBody(responseFeatures.Body, rcEncoding); - + responseFeatures.Body.Position = 0L; } PostMarshallResponseFeature(responseFeatures, response, lambdaContext);