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

Fix crash when --interface is wsgi #730

Merged
merged 2 commits into from Jul 30, 2020

Conversation

mpaolini
Copy link
Contributor

This is a regression introduced in
ae0fd31 (#597)

This is a regression introduced in
ae0fd31 (encode#597)
@@ -202,7 +202,7 @@ def __init__(

@property
def asgi_version(self) -> str:
return {"asgi2": "2.0", "asgi3": "3.0"}[self.interface]
return {"asgi2": "2.0", "asgi3": "3.0", "wsgi": "2.0"}[self.interface]
Copy link
Member

Choose a reason for hiding this comment

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

The WSGIMiddleware uses the ASGI3 callable interface, so I think we should use "wsgi": "3.0".

(That said I think we can acknowledge that this is fuzzy, because "I'm serving a WSGI app under the hood" isn't something that's planned by the ASGI spec. This is merely a convenience feature provided by Uvicorn.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

Copy link
Member

@florimondmanca florimondmanca left a comment

Choose a reason for hiding this comment

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

Sounds good to me. As I said it's a fuzzy area not covered by the spec, but obviously there's a bug worth resolving and we need to provide an asgi_version in all cases, so… Thanks!

@florimondmanca florimondmanca merged commit 0380c4e into encode:master Jul 30, 2020
@florimondmanca florimondmanca mentioned this pull request Jul 30, 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.

None yet

2 participants