summary refs log tree commit diff
path: root/synapse/http/server.py
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2015-04-01 15:05:30 +0100
committerDavid Baker <dave@matrix.org>2015-04-01 15:05:30 +0100
commite9c908ebc09ccc050bd09692c5413124a8c3c06e (patch)
tree8e22da7bc4130e9fe54a5843e12a16b1b4327543 /synapse/http/server.py
parentMake docs a bit more true (diff)
downloadsynapse-e9c908ebc09ccc050bd09692c5413124a8c3c06e.tar.xz
Completely replace fallback auth for C/S V2:
 * Now only the auth part goes to fallback, not the whole operation
 * Auth fallback is a normal API endpoint, not a static page
 * Params like the recaptcha pubkey can just live in the config
Involves a little engineering on JsonResource so its servlets aren't always forced to return JSON. I should document this more, in fact I'll do that now.
Diffstat (limited to 'synapse/http/server.py')
-rw-r--r--synapse/http/server.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/synapse/http/server.py b/synapse/http/server.py
index 30c3aa5cac..76c561d105 100644
--- a/synapse/http/server.py
+++ b/synapse/http/server.py
@@ -170,9 +170,12 @@ class JsonResource(HttpServer, resource.Resource):
                     request.method, request.path
                 )
 
-                code, response = yield callback(request, *args)
+                callback_return = yield callback(request, *args)
+                if callback_return is not None:
+                    code, response = callback_return
+
+                    self._send_response(request, code, response)
 
-                self._send_response(request, code, response)
                 response_timer.inc_by(
                     self.clock.time_msec() - start, request.method, servlet_classname
                 )