diff options
author | Amber Brown <hawkowl@atleastfornow.net> | 2018-08-20 23:54:49 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-20 23:54:49 +1000 |
commit | 324525f40ca4df19c43971ca82db0d3478114885 (patch) | |
tree | 05e6a1e45e711c9d5d18b7fbf31c79aa03fb0657 /synapse/http/site.py | |
parent | Merge pull request #3719 from matrix-org/erikj/use_cache_fact (diff) | |
download | synapse-324525f40ca4df19c43971ca82db0d3478114885.tar.xz |
Port over enough to get some sytests running on Python 3 (#3668)
Diffstat (limited to 'synapse/http/site.py')
-rw-r--r-- | synapse/http/site.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/http/site.py b/synapse/http/site.py index f5a8f78406..ad2a98468e 100644 --- a/synapse/http/site.py +++ b/synapse/http/site.py @@ -235,7 +235,7 @@ class SynapseRequest(Request): # need to decode as it could be raw utf-8 bytes # from a IDN servname in an auth header authenticated_entity = self.authenticated_entity - if authenticated_entity is not None: + if authenticated_entity is not None and isinstance(authenticated_entity, bytes): authenticated_entity = authenticated_entity.decode("utf-8", "replace") # ...or could be raw utf-8 bytes in the User-Agent header. @@ -328,7 +328,7 @@ class SynapseSite(Site): proxied = config.get("x_forwarded", False) self.requestFactory = SynapseRequestFactory(self, proxied) self.access_logger = logging.getLogger(logger_name) - self.server_version_string = server_version_string + self.server_version_string = server_version_string.encode('ascii') def log(self, request): pass |