Skip to content

Commit

Permalink
Add reference to the Mangum project for adapted logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jbfenton committed Jun 7, 2024
1 parent bda94f8 commit b66dfd6
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@ def headers(self) -> dict:
Returns: Headers for the Application Load Balancer event.
"""

# This approach was adapted from the Mangum project:
# https://github.com/jordaneremieff/mangum
headers: List[Tuple[bytes, bytes]] = []

if "multiValueHeaders" in self._event:
Expand Down Expand Up @@ -673,6 +675,8 @@ def get_event_wrapper(event: LambdaEvent, context: Any) -> EventWrapper:

default_wrapper = EventWrapper(event=event, context=context)

# The logic behind this flow was adapted from work done by the Mangum project:
# https://github.com/jordaneremieff/mangum
if not event:
return default_wrapper
elif "requestContext" in event and "elb" in event["requestContext"]:
Expand Down

0 comments on commit b66dfd6

Please sign in to comment.