summary refs log tree commit diff
path: root/synapse/server.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-06-15 14:45:52 +0100
committerErik Johnston <erik@matrix.org>2015-06-15 14:45:52 +0100
commit44c9102e7ae8199c311faf42fb3fbec437acd28a (patch)
tree02f9401470bdbde5545a99ee1bb111f2bb2a0297 /synapse/server.py
parentMake http.server request logging more verbose, but redact access_tokens (diff)
parentRemove redundant newline (diff)
downloadsynapse-44c9102e7ae8199c311faf42fb3fbec437acd28a.tar.xz
Merge branch 'erikj/listeners_config' into erikj/sanitize_logging
Diffstat (limited to 'synapse/server.py')
-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