[tor-commits] [bridgedb/develop] Add docstring to HTTPServer.CaptchaProtectedResource.getClientIP().
isis at torproject.org
isis at torproject.org
Wed May 14 22:41:20 UTC 2014
commit 48d1281e5c641641c099ac5bcd47a60f4527fc9b
Author: Isis Lovecruft <isis at torproject.org>
Date: Wed May 14 20:05:02 2014 +0000
Add docstring to HTTPServer.CaptchaProtectedResource.getClientIP().
---
lib/bridgedb/HTTPServer.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lib/bridgedb/HTTPServer.py b/lib/bridgedb/HTTPServer.py
index 328d7a3..779e270 100644
--- a/lib/bridgedb/HTTPServer.py
+++ b/lib/bridgedb/HTTPServer.py
@@ -144,6 +144,12 @@ class CaptchaProtectedResource(resource.Resource):
self.resource = protectedResource
def getClientIP(self, request):
+ """Get the client's IP address from the :header:`X-Forwarded-For`
+ header, or from the :api:`request <twisted.web.server.Request>`.
+
+ :rtype: None or str
+ :returns: The client's IP address, if it was obtainable.
+ """
ip = None
if self.useForwardedHeader:
h = request.getHeader("X-Forwarded-For")
More information about the tor-commits
mailing list