Skip to content

Commit

Permalink
Fix crash when --interface is wsgi
Browse files Browse the repository at this point in the history
This is a regression introduced in
ae0fd31 (encode#597)
  • Loading branch information
mpaolini committed Jul 29, 2020
1 parent 7163e95 commit 938f72a
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def test_wsgi_app():

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


def test_proxy_headers():
Expand Down
2 changes: 1 addition & 1 deletion uvicorn/config.py
Original file line number Diff line number Diff line change
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": "2.0"}[self.interface]

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

0 comments on commit 938f72a

Please sign in to comment.