summary refs log tree commit diff
path: root/synapse/http
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2018-05-24 16:20:53 +0100
committerDavid Baker <dave@matrix.org>2018-05-24 16:20:53 +0100
commit77a23e2e058bbc02a675bd6e14bff2c9906c68b2 (patch)
tree5b65ad8562dc2d584b35b47999b5e004ad21b387 /synapse/http
parentpep8 (diff)
parentMerge pull request #3277 from matrix-org/dbkr/remove_from_user_dir (diff)
downloadsynapse-77a23e2e058bbc02a675bd6e14bff2c9906c68b2.tar.xz
Merge remote-tracking branch 'origin/develop' into dbkr/unbind
Diffstat (limited to 'synapse/http')
-rw-r--r--synapse/http/matrixfederationclient.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py
index 21eaf77dc4..c7f919498c 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
+
 
 logger = logging.getLogger(__name__)
 outbound_logger = logging.getLogger("synapse.http.outbound")
@@ -558,7 +560,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]
 
@@ -673,7 +675,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"
@@ -690,7 +692,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]