Skip to content

Commit

Permalink
πŸ“ add documentation to create scope function
Browse files Browse the repository at this point in the history
  • Loading branch information
ediskandarov committed Feb 27, 2021
1 parent 2b71225 commit 191b478
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mangum/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,15 @@ def __call__(self, event: dict, context: "LambdaContext") -> dict:
return response

def _create_scope(self, event: dict, context: "LambdaContext") -> Scope:
"""Creates a scope object according to ASGI specification from a Lambda Event.
https://asgi.readthedocs.io/en/latest/specs/www.html#http-connection-scope
The event comes from various sources: AWS ALB, AWS API Gateway of different
versions and configurations(multivalue header, etc).
Thus, some heuristics is applied to guess an event type.
"""
request_context = event["requestContext"]

if event.get("multiValueHeaders"):
Expand Down

0 comments on commit 191b478

Please sign in to comment.