summary refs log tree commit diff
path: root/synapse/rest/register.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-09-26 16:36:24 +0100
committerErik Johnston <erik@matrix.org>2014-09-26 16:36:24 +0100
commit0fdf3088743b25e9fcc39b7b3b4c7f6e8332e26c (patch)
treea5433fb7afa8fb62c65f5a4395c7ed7b1f0a9af4 /synapse/rest/register.py
parentMerge branch 'master' of github.com:matrix-org/synapse into develop (diff)
downloadsynapse-0fdf3088743b25e9fcc39b7b3b4c7f6e8332e26c.tar.xz
Track the IP users connect with. Add an admin column to users table.
Diffstat (limited to 'synapse/rest/register.py')
-rw-r--r--synapse/rest/register.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/synapse/rest/register.py b/synapse/rest/register.py
index 4935e323d9..804117ee09 100644
--- a/synapse/rest/register.py
+++ b/synapse/rest/register.py
@@ -195,13 +195,7 @@ class RegisterRestServlet(RestServlet):
             raise SynapseError(400, "Captcha response is required",
                                errcode=Codes.CAPTCHA_NEEDED)
 
-        # May be an X-Forwarding-For header depending on config
-        ip_addr = request.getClientIP()
-        if self.hs.config.captcha_ip_origin_is_x_forwarded:
-            # use the header
-            if request.requestHeaders.hasHeader("X-Forwarded-For"):
-                ip_addr = request.requestHeaders.getRawHeaders(
-                    "X-Forwarded-For")[0]
+        ip_addr = self.hs.get_ip_from_request(request)
 
         handler = self.handlers.registration_handler
         yield handler.check_recaptcha(