Skip to content

Commit

Permalink
Fix crash when --interface is wsgi (#730)
Browse files Browse the repository at this point in the history
* Fix crash when --interface is wsgi

This is a regression introduced in
ae0fd31 (#597)

* Set asgi 3.0
  • Loading branch information
mpaolini committed Jul 30, 2020
1 parent 7163e95 commit 0380c4e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/test_config.py
Expand Up @@ -31,6 +31,7 @@ def test_wsgi_app():

assert isinstance(config.loaded_app, WSGIMiddleware)
assert config.interface == "wsgi"
assert config.asgi_version == "3.0"


def test_proxy_headers():
Expand Down
2 changes: 1 addition & 1 deletion uvicorn/config.py
Expand Up @@ -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": "3.0"}[self.interface]

@property
def is_ssl(self) -> bool:
Expand Down

0 comments on commit 0380c4e

Please sign in to comment.