-
Notifications
You must be signed in to change notification settings - Fork 503
AWS Lambda - Supporting binary response in ASP.NET Core 6 #1574
Copy link
Copy link
Closed
Labels
feature-requestA feature should be added or improved.A feature should be added or improved.in-progressResolution to this issue is being actively worked on.Resolution to this issue is being actively worked on.module/aspnetcore-supportp2This is a standard priority issueThis is a standard priority issuepr/work-in-progressThis PR is a draft and needs further work.This PR is a draft and needs further work.
Description
Activity
Metadata
Metadata
Assignees
Labels
feature-requestA feature should be added or improved.A feature should be added or improved.in-progressResolution to this issue is being actively worked on.Resolution to this issue is being actively worked on.module/aspnetcore-supportp2This is a standard priority issueThis is a standard priority issuepr/work-in-progressThis PR is a draft and needs further work.This PR is a draft and needs further work.
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