Revert "more login hacking"

This reverts commit 47d2b49e2b.

This has now been superceded on develop by PR 9472.
michaelkaye/remove_warning
Richard van der Hoff 2021-02-26 14:04:05 +00:00
parent 5d405f7e7a
commit c7934aee2c
1 changed files with 4 additions and 18 deletions

View File

@ -333,27 +333,13 @@ class SynapseRequest(Request):
class XForwardedForRequest(SynapseRequest): class XForwardedForRequest(SynapseRequest):
"""
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): def __init__(self, *args, **kw):
SynapseRequest.__init__(self, *args, **kw) SynapseRequest.__init__(self, *args, **kw)
forwarded_header = self.getHeader(b"x-forwarded-proto") """
if forwarded_header is not None: Add a layer on top of another request that only uses the value of an
self._is_secure = forwarded_header.lower() == b"https" X-Forwarded-For header as the result of C{getClientIP}.
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): def getClientIP(self):
""" """