summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--synapse/handlers/register.py2
-rw-r--r--synapse/http/client.py10
2 files changed, 3 insertions, 9 deletions
diff --git a/synapse/handlers/register.py b/synapse/handlers/register.py
index 266495056e..df562aa762 100644
--- a/synapse/handlers/register.py
+++ b/synapse/handlers/register.py
@@ -176,7 +176,7 @@ class RegistrationHandler(BaseHandler):
 
     @defer.inlineCallbacks
     def _bind_threepid(self, creds, mxid):
-        httpCli = PlainHttpClient(self.hs)
+        httpCli = IdentityServerHttpClient(self.hs)
         data = yield httpCli.post_urlencoded_get_json(
             creds['idServer'],
             "/_matrix/identity/api/v1/3pid/bind",
diff --git a/synapse/http/client.py b/synapse/http/client.py
index 57b49355f2..5c2fbd1f87 100644
--- a/synapse/http/client.py
+++ b/synapse/http/client.py
@@ -236,9 +236,6 @@ class IdentityServerHttpClient(BaseHttpClient):
 
     @defer.inlineCallbacks
     def post_urlencoded_get_json(self, destination, path, args={}):
-        if destination in _destination_mappings:
-            destination = _destination_mappings[destination]
-
         logger.debug("post_urlencoded_get_json args: %s", args)
         query_bytes = urllib.urlencode(args, True)
 
@@ -246,7 +243,7 @@ class IdentityServerHttpClient(BaseHttpClient):
             destination.encode("ascii"),
             "POST",
             path.encode("ascii"),
-            producer=FileBodyProducer(StringIO(urllib.urlencode(args))),
+            producer=FileBodyProducer(StringIO(query_bytes)),
             headers_dict={
                 "Content-Type": ["application/x-www-form-urlencoded"]
             }
@@ -266,16 +263,13 @@ class CaptchaServerHttpClient(MatrixHttpClient):
     @defer.inlineCallbacks
     def post_urlencoded_get_raw(self, destination, path, accept_partial=False,
                                 args={}):
-        if destination in _destination_mappings:
-            destination = _destination_mappings[destination]
-
         query_bytes = urllib.urlencode(args, True)
 
         response = yield self._create_request(
             destination.encode("ascii"),
             "POST",
             path.encode("ascii"),
-            producer=FileBodyProducer(StringIO(urllib.urlencode(args))),
+            producer=FileBodyProducer(StringIO(query_bytes)),
             headers_dict={
                 "Content-Type": ["application/x-www-form-urlencoded"]
             }