summary refs log tree commit diff
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2021-02-26 14:04:05 +0000
committerRichard van der Hoff <richard@matrix.org>2021-02-26 14:04:05 +0000
commitc7934aee2caaed19200450cea1e94c2969b78a26 (patch)
tree04e4a2321c865b287485629bba733d956061be9f
parentMerge remote-tracking branch 'origin/develop' into matrix-org-hotfixes (diff)
downloadsynapse-c7934aee2caaed19200450cea1e94c2969b78a26.tar.xz
Revert "more login hacking"
This reverts commit 47d2b49e2b938a1c0c2e13830505a6d019ee65fe.

This has now been superceded on develop by PR 9472.
-rw-r--r--synapse/http/site.py20
1 files changed, 3 insertions, 17 deletions
diff --git a/synapse/http/site.py b/synapse/http/site.py

index 7421c172e4..4a4fb5ef26 100644 --- a/synapse/http/site.py +++ b/synapse/http/site.py
@@ -333,28 +333,14 @@ class SynapseRequest(Request): class XForwardedForRequest(SynapseRequest): + def __init__(self, *args, **kw): + SynapseRequest.__init__(self, *args, **kw) + """ Add a layer on top of another request that only uses the value of an X-Forwarded-For header as the result of C{getClientIP}. - - XXX: I think the right way to do this is with request.setHost(). """ - def __init__(self, *args, **kw): - SynapseRequest.__init__(self, *args, **kw) - - forwarded_header = self.getHeader(b"x-forwarded-proto") - if forwarded_header is not None: - self._is_secure = forwarded_header.lower() == b"https" - else: - logger.warning( - "received request lacks an x-forwarded-proto header: assuming https" - ) - self._is_secure = True - - def isSecure(self): - return self._is_secure - def getClientIP(self): """ @return: The client address (the first address) in the value of the