-
Notifications
You must be signed in to change notification settings - Fork 478
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
AWS Lambda - Supporting binary response in ASP.NET Core 6 #1574
Comments
I'm facing the same issue, a solution would be great. |
Hi @ashishdhingra, Thanks for your reply. |
What I did for the moment is creating my own Custom
Custom
And in my
|
I really hope that a best solution will be provided and that we will be able to add those kind of transformation directly in the Program.cs file when adding the service to the service collection |
@hugohlln very good idea, I will try it too. |
Describe the bug
Hello,
I'm creating an ASP.NET Core 6 Rest API running in a lambda behind an API Gateway.
We have somme issues since we would like to return image/webp content and we are not able to do it.
We've seen that a solution exists for ASP.NET Core 2 by calling the following method :
RegisterResponseContentEncodingForContentType("image/webp", ResponseContentEncoding.Base64);
But unforunately we didn't find any information or tutorial to do the same thing using ASP.NET Core 6 cause the lambda support is done as below in the Program.cs file :
builder.Services.AddAWSLambdaHosting(LambdaEventSource.RestApi);
Is there any way to register image/webp conte type for Base64 transformation in ASP.NET Core 6 using the
builder.Services.AddAWSLambdaHosting(LambdaEventSource.RestApi);
method ?Thanks
Expected Behavior
Be able to register content-types for Base64 transformation in ASP.NET Core 6 Program.cs file
Current Behavior
Unable to register content-types for Base64 transformation in ASP.NET Core 6 Program.cs file
Reproduction Steps
(builder.Services.AddAWSLambdaHosting(LambdaEventSource.RestApi);)
[HttpGet] public ActionResult GetWebp() { var image = System.IO.File.ReadAllBytes("myImage.webp"); return File(image, "image/webp"); } }
Possible Solution
No response
Additional Information/Context
No response
AWS .NET SDK and/or Package version used
Amazon.Lambda.AspNetCoreServer.Hosting 1.6.0
Targeted .NET Platform
ASP.NET Core 6.0
Operating System and version
Any
The text was updated successfully, but these errors were encountered: