[FIX] http.dispatch: call handle_exception() even w/ session missing/expired

This gives JSONRequests a chance to return
a proper JSON-RPC result when an HTTPException
is raised downstream, instead of returning a
plain HTML 404 error.
This commit is contained in:
Olivier Dony 2014-06-25 17:41:24 +02:00
parent bac08227e2
commit 141e1b2615
1 changed files with 4 additions and 1 deletions

View File

@ -1118,7 +1118,10 @@ class Root(object):
request = self.get_request(httprequest)
def _dispatch_nodb():
func, arguments = self.nodb_routing_map.bind_to_environ(request.httprequest.environ).match()
try:
func, arguments = self.nodb_routing_map.bind_to_environ(request.httprequest.environ).match()
except werkzeug.exceptions.HTTPException, e:
return request._handle_exception(e)
request.set_handler(func, arguments, "none")
result = request.dispatch()
return result