Description
Describe the Feature
Add support for easily configuring the content type/encoding for returning binary data from an application when using Amazon.Lambda.AspNetCoreServer.
Is your Feature Request related to a problem?
The recommended way to host an ASP.NET Core Minimal API in AWS Lambda is with a single line of code:
builder.Services.AddAWSLambdaHosting(LambdaEventSource.RestApi);
However, if the user needs to update the content type/encoding mappings to support binary content not already configured by default, there is no hook available to the user to call the relevant methods on the code that maps the API Gateway responses from ASP.NET Core to the response for the Lambda runtime.
The only way to access this functionality is to re-implement the code called through AddAWSLambdaHosting()
so that they construct the relevant concrete AbstractAspNetCoreFunction
type themselves so they can call the method(s) as appropriate to their use case.
Proposed Solution
Some sort of configuration delegate that allows the user to configure the mappings.
Describe alternatives you've considered
I tried looking at an IStartupFilter
to reach into the IoC container on startup to modify the IServer
by casting it back to the correct type and configuring it manually, but that does not appear to be possible
Additional Context
Prevents easy use of Amazon.Lambda.AspNetCoreServer without copy parts of the internal configuration of the server so that the relevant methods can be called to configure the encodings.
Environment
- 👋 I may be able to implement this feature request
-
⚠️ This feature might incur a breaking change
This is a 🚀 Feature Request