Skip to content

Amazon.Lambda.AspNetCoreServer different behaviour on local and AWS #235

@CrazyBaran

Description

@CrazyBaran

Hello AWS Team,

There is some problem with your implementation of LambdaEntryPoint, behavior is diffferent than this which is on LocalEntryPoint. To recreate this case you need to made CustomAttribute:

public class CustomAttribute : ActionFilterAttribute
   {
       public override void OnActionExecuted(ActionExecutedContext actionExecutedContext)
       {
           HttpResponse response = actionExecutedContext.HttpContext.Response;
           LambdaLogger.Log("Test "+ response.StatusCode+ " "+ (response != null).ToString() +" " + 
               response.IsSuccessStatusCode().ToString()+ " " + (actionExecutedContext.Result != null).ToString());
           
           base.OnActionExecuted(actionExecutedContext);
       }
   }  

If you test this CustomAttribute with localEntry you will see that StatusCode is set, but when you debug this on AWS you will get 0 cause something work in different order. I investigate this issue with OData team here: OData/WebApi#1227

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions