Skip to content
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

asgi: check raw_path is not None #719

Merged
merged 1 commit into from
May 4, 2020
Merged

asgi: check raw_path is not None #719

merged 1 commit into from
May 4, 2020

Conversation

cldellow
Copy link
Contributor

@cldellow cldellow commented Apr 5, 2020

The ASGI spec
(https://asgi.readthedocs.io/en/latest/specs/www.html#http) seems to imply that None is a valid value, so we need to check the value itself, not just whether the key is present.

In particular, the mangum adapter passes None for this key's value. This change permits mangum to be used to front datasette in Amazon API Gateway + AWS Lambda deployments.

The ASGI spec
(https://asgi.readthedocs.io/en/latest/specs/www.html#http) seems to
imply that `None` is a valid value, so we need to check the value
itself, not just whether the key is present.

In particular, the [mangum](https://github.com/erm/mangum) adapter
passes `None` for this key.
@simonw
Copy link
Owner

simonw commented May 4, 2020

Thanks, this is a smart fix.

@simonw simonw merged commit dbd2d70 into simonw:master May 4, 2020
simonw added a commit that referenced this pull request May 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants