diff options
author | Amber Brown <hawkowl@atleastfornow.net> | 2018-05-28 18:57:23 +1000 |
---|---|---|
committer | Amber Brown <hawkowl@atleastfornow.net> | 2018-05-28 18:57:23 +1000 |
commit | 754826a8305b3f32a45367cb6bd8bb26bd489a6b (patch) | |
tree | c5aba5e1e720474b3f94d15bd9202bda0b120e20 /synapse/http | |
parent | pepeightttt (diff) | |
parent | Merge pull request #3288 from matrix-org/rav/no_spam_guests (diff) | |
download | synapse-754826a8305b3f32a45367cb6bd8bb26bd489a6b.tar.xz |
Merge remote-tracking branch 'origin/develop' into 3218-official-prom
Diffstat (limited to 'synapse/http')
-rw-r--r-- | synapse/http/matrixfederationclient.py | 8 | ||||
-rw-r--r-- | synapse/http/site.py | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py index 77eaa06a1a..821aed362b 100644 --- a/synapse/http/matrixfederationclient.py +++ b/synapse/http/matrixfederationclient.py @@ -42,6 +42,8 @@ import random import sys import urllib from six.moves.urllib import parse as urlparse +from six import string_types + from prometheus_client import Counter @@ -549,7 +551,7 @@ class MatrixFederationHttpClient(object): encoded_args = {} for k, vs in args.items(): - if isinstance(vs, basestring): + if isinstance(vs, string_types): vs = [vs] encoded_args[k] = [v.encode("UTF-8") for v in vs] @@ -664,7 +666,7 @@ def check_content_type_is_json(headers): RuntimeError if the """ - c_type = headers.getRawHeaders("Content-Type") + c_type = headers.getRawHeaders(b"Content-Type") if c_type is None: raise RuntimeError( "No Content-Type header" @@ -681,7 +683,7 @@ def check_content_type_is_json(headers): def encode_query_args(args): encoded_args = {} for k, vs in args.items(): - if isinstance(vs, basestring): + if isinstance(vs, string_types): vs = [vs] encoded_args[k] = [v.encode("UTF-8") for v in vs] diff --git a/synapse/http/site.py b/synapse/http/site.py index b608504225..23c1b76922 100644 --- a/synapse/http/site.py +++ b/synapse/http/site.py @@ -56,7 +56,7 @@ class SynapseRequest(Request): def __repr__(self): # We overwrite this so that we don't log ``access_token`` - return '<%s at 0x%x method=%s uri=%s clientproto=%s site=%s>' % ( + return '<%s at 0x%x method=%r uri=%r clientproto=%r site=%r>' % ( self.__class__.__name__, id(self), self.method, |