Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .autover/changes/6ecba481-6957-4fd3-a562-dcf8676ab88c.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"Projects": [
{
"Name": "Amazon.Lambda.AspNetCoreServer",
"Type": "Patch",
"ChangelogMessages": [
"Fixed issue when executing AddRegisterBeforeSnapshot callbacks to ensure each invocation has a new ASP.NET Core feature collection and HttpContext."
]
},
{
"Name": "Amazon.Lambda.AspNetCoreServer.Hosting",
"Type": "Patch",
"ChangelogMessages": [
"Update Amazon.Lambda.AspNetCoreServer dependency for latest patch fix."
]
}
]
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Amazon.Lambda.AspNetCoreServer.Internal;
using Amazon.Lambda.AspNetCoreServer.Internal;
using Amazon.Lambda.Core;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http.Features;
Expand Down Expand Up @@ -318,16 +318,16 @@ private void AddRegisterBeforeSnapshot()

var request = await HttpRequestMessageConverter.ConvertToLambdaRequest<TREQUEST>(httpRequest);

InvokeFeatures features = new InvokeFeatures();
(features as IItemsFeature).Items = new Dictionary<object, object>();
(features as IServiceProvidersFeature).RequestServices = _hostServices;
for (var i = 0; i < invokeTimes; i++)
{
InvokeFeatures features = new InvokeFeatures();
(features as IItemsFeature).Items = new Dictionary<object, object>();
(features as IServiceProvidersFeature).RequestServices = _hostServices;

MarshallRequest(features, request, new SnapStartEmptyLambdaContext());
MarshallRequest(features, request, new SnapStartEmptyLambdaContext());

var context = CreateContext(features);
var context = CreateContext(features);

for (var i = 0; i < invokeTimes; i++)
{
var lambdaContext = new SnapStartEmptyLambdaContext();

await ProcessRequest(lambdaContext, context, features);
Expand Down
Loading