Skip to content

fix: add support for null/invalid type for headers #371

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

Merged
merged 1 commit into from
Nov 28, 2021

Conversation

nmoutschen
Copy link
Contributor

@nmoutschen nmoutschen commented Nov 21, 2021

Issue #, if available: #367

Description of changes:

This adds support for invalid/null value for headers, defaulting to an empty HeaderMap if need be, increasing resilience if the Lambda function would get an invalid value for headers.

I've also added additional checks in the request deserialization tests to ensure we deserialize from the right type of API, as making deserialization more permissive could potentially break this.

Open question before merging this: this change is overly permissive. Should I scope this down to only accepting null and map values?

By submitting this pull request

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I confirm that I've made a best effort attempt to update all relevant documentation.

Copy link
Contributor

@coltonweaver coltonweaver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for doing this.

WRT your overly permissive question - I think it's fine to do things like this in lambda_http.

@nmoutschen nmoutschen merged commit 6b1b3f0 into awslabs:master Nov 28, 2021
@nmoutschen nmoutschen deleted the nullable-headers branch November 28, 2021 10:00
@nmoutschen nmoutschen added the 0.5 label Feb 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants