Skip to content

AspNetCoreServer: APIGatewayHttpApiV2ProxyFunction does not return multiple cookies correctly. #750

@petli

Description

@petli

Description

#713 reported that multiple cookies couldn't be handled, either in the HTTP requests or the responses. It was closed by #729, but that PR unfortunately only addressed the request bug, not the response bug, which is still present in 5.1.6.

Reproduction Steps

See #713

Environment

  • Build Version: 5.1.6
  • OS Info: Windows 10, Linux
  • Build Environment: Visual Studio, dotnet CLI
  • Targeted .NET Platform: .NET Core 3.1

Resolution

  • 👋 I can/would-like-to implement a fix for this problem myself

Workaround from #713 until PR is merged:

protected override void PostMarshallResponseFeature(IHttpResponseFeature httpResponse, APIGatewayHttpApiV2ProxyResponse lambdaResponse, ILambdaContext lambdaContext)
{
    lambdaResponse.Headers?.Remove(HeaderNames.SetCookie);
    lambdaResponse.Cookies = httpResponse.Headers[HeaderNames.SetCookie].ToArray();
}

This is a 🐛 bug-report

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions