diff --git a/asgiref/wsgi.py b/asgiref/wsgi.py index 40fba205..bf1be604 100644 --- a/asgiref/wsgi.py +++ b/asgiref/wsgi.py @@ -76,7 +76,7 @@ def build_environ(self, scope, body): environ["SERVER_NAME"] = "localhost" environ["SERVER_PORT"] = "80" - if "client" in scope: + if scope.get("client") is not None: environ["REMOTE_ADDR"] = scope["client"][0] # Go through headers and make them into environ entries