summary refs log tree commit diff
path: root/synapse/server.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-06-12 17:13:23 +0100
committerErik Johnston <erik@matrix.org>2015-06-12 17:13:23 +0100
commit9c5fc81c2ddd29eac62d368e7f8d24972f8894a6 (patch)
tree3ad573b34ebe9e185fca9d6546366c3df3cb33ab /synapse/server.py
parentUse config.listeners (diff)
downloadsynapse-9c5fc81c2ddd29eac62d368e7f8d24972f8894a6.tar.xz
Correctly handle x_forwaded listener option
Diffstat (limited to '')
-rw-r--r--synapse/server.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/synapse/server.py b/synapse/server.py
index 8b3dc675cc..4d1fb1cbf6 100644
--- a/synapse/server.py
+++ b/synapse/server.py
@@ -132,16 +132,8 @@ class BaseHomeServer(object):
         setattr(BaseHomeServer, "get_%s" % (depname), _get)
 
     def get_ip_from_request(self, request):
-        # May be an X-Forwarding-For header depending on config
-        ip_addr = request.getClientIP()
-        if self.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]
-
-        return ip_addr
+        # X-Forwarded-For is handled by our custom request type.
+        return request.getClientIP()
 
     def is_mine(self, domain_specific_string):
         return domain_specific_string.domain == self.hostname