[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [bridgedb/develop] Add docstring to HTTPServer.CaptchaProtectedResource.getClientIP().
commit 48d1281e5c641641c099ac5bcd47a60f4527fc9b
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
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")
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits