]> git.ipfire.org Git - thirdparty/starlette.git/commitdiff
Fix documentation on client address type (#2580)
authorjulien4215 <120588494+julien4215@users.noreply.github.com>
Thu, 25 Apr 2024 06:49:38 +0000 (08:49 +0200)
committerGitHub <noreply@github.com>
Thu, 25 Apr 2024 06:49:38 +0000 (08:49 +0200)
docs/requests.md
starlette/requests.py

index f8d19bb9bda6a0022678761fd3429dcec509f112..9140bb964f7c49c4718455542d5f25ed3f9a39e9 100644 (file)
@@ -60,8 +60,7 @@ For example: `request.path_params['username']`
 
 #### Client Address
 
-The client's remote address is exposed as a named two-tuple `request.client`.
-Either item in the tuple may be `None`.
+The client's remote address is exposed as a named two-tuple `request.client` (or `None`).
 
 The hostname or IP address: `request.client.host`
 
index b27e8e1e269f1bdbb43daf6d03ea0ca13e470d4a..a2fdfd81eda6a308c00cb2b36db8af8dc77e6e2e 100644 (file)
@@ -145,7 +145,7 @@ class HTTPConnection(typing.Mapping[str, typing.Any]):
 
     @property
     def client(self) -> Address | None:
-        # client is a 2 item tuple of (host, port), None or missing
+        # client is a 2 item tuple of (host, port), None if missing
         host_port = self.scope.get("client")
         if host_port is not None:
             return Address(*host_port)