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.
This commit is contained in:
David Baker 2015-04-01 15:05:30 +01:00
parent f129ee1e18
commit e9c908ebc0
6 changed files with 280 additions and 26 deletions

View file

@ -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
)