summary refs log tree commit diff
path: root/synapse/handlers/register.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-10-02 13:57:48 +0100
committerMark Haines <mark.haines@matrix.org>2014-10-02 14:03:26 +0100
commit4f11518934c3e032a763f115a73261414d67f87b (patch)
tree030ed29a6bbf57f706be58bcdcde8536bfafe5d0 /synapse/handlers/register.py
parentMerge branch 'master' into develop (diff)
downloadsynapse-4f11518934c3e032a763f115a73261414d67f87b.tar.xz
Split PlainHttpClient into separate clients for talking to Identity servers and talking to Capatcha servers
Diffstat (limited to 'synapse/handlers/register.py')
-rw-r--r--synapse/handlers/register.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/synapse/handlers/register.py b/synapse/handlers/register.py
index a019d770d4..266495056e 100644
--- a/synapse/handlers/register.py
+++ b/synapse/handlers/register.py
@@ -22,7 +22,8 @@ from synapse.api.errors import (
 )
 from ._base import BaseHandler
 import synapse.util.stringutils as stringutils
-from synapse.http.client import PlainHttpClient
+from synapse.http.client import IdentityServerHttpClient
+from synapse.http.client import CaptchaServerHttpClient
 
 import base64
 import bcrypt
@@ -154,7 +155,9 @@ class RegistrationHandler(BaseHandler):
 
     @defer.inlineCallbacks
     def _threepid_from_creds(self, creds):
-        httpCli = PlainHttpClient(self.hs)
+        # TODO: get this from the homeserver rather than creating a new one for
+        # each request
+        httpCli = IdentityServerHttpClient(self.hs)
         # XXX: make this configurable!
         trustedIdServers = ['matrix.org:8090']
         if not creds['idServer'] in trustedIdServers:
@@ -203,7 +206,9 @@ class RegistrationHandler(BaseHandler):
 
     @defer.inlineCallbacks
     def _submit_captcha(self, ip_addr, private_key, challenge, response):
-        client = PlainHttpClient(self.hs)
+        # TODO: get this from the homeserver rather than creating a new one for
+        # each request
+        client = CaptchaServerHttpClient(self.hs)
         data = yield client.post_urlencoded_get_raw(
             "www.google.com:80",
             "/recaptcha/api/verify",