Skip to content

Feature request: Default ALBResolver Response body to empty string instead of None #4671

Closed
@TonySherman

Description

@TonySherman

Use case

There are times when I only need to return a 200 response without a body. Currently, if I return the Response class without a body while using the ALBResolver, the load balancer will return a 502, even when the lambda successfully returns a response.

Solution/User Experience

When returning Response(status_code=200) the body would default to an empty string rather than None.

I did take a look at the ALB docs and it does state:

The response from your Lambda function must include the Base64 encoding status, status code, and headers. You can omit the body.

So maybe there is another issue causing the 502 that I was seeing.

Alternative solutions

No response

Acknowledgment

  • This feature request meets Powertools for AWS Lambda (Python) Tenets
    Should this be considered in other Powertools for AWS Lambda languages? i.e. Java, TypeScript, and .NET

Activity

github-actions

github-actions commented on Jul 3, 2024

@github-actions
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

This issue is now closed. Please be mindful that future comments are hard for our team to see.

If you need more assistance, please either tag a team member or open a new issue that references this one.

If you wish to keep having a conversation with other community members under this issue feel free to do so.

github-actions

github-actions commented on Jul 11, 2024

@github-actions
Contributor

This is now released under 2.41.0 version!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestfeature requesttriagePending triage from maintainers

    Type

    No type

    Projects

    Status

    Shipped

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @leandrodamascena@TonySherman

        Issue actions

          Feature request: Default ALBResolver Response body to empty string instead of None · Issue #4671 · aws-powertools/powertools-lambda-python