Skip to content

Commit

Permalink
Handle "client": None in WsgiToAsgi adapter (#411)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekzhang committed Oct 6, 2023
1 parent 2ddc82c commit 56cc620
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion asgiref/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 56cc620

Please sign in to comment.