[FIX] http: stop altering endpoints during routing

Request arguments were being stored on the routing
endpoint during the dispatching.
This could cause request0 to use parameters from request1
if request1.set_handler() is called before request0's
dispatching is over. No reason to store request arguments
on routing endpoints anyway.
This commit is contained in:
Olivier Dony
2015-09-10 20:51:07 +02:00
parent 40b846241c
commit 8d2a3ba12d
+4 -2
View File
@@ -185,6 +185,7 @@ class WebRequest(object):
self.disable_db = False
self.uid = None
self.endpoint = None
self.endpoint_arguments = None
self.auth_method = None
self._cr = None
@@ -267,7 +268,7 @@ class WebRequest(object):
arguments = dict((k, v) for k, v in arguments.iteritems()
if not k.startswith("_ignored_"))
endpoint.arguments = arguments
self.endpoint_arguments = arguments
self.endpoint = endpoint
self.auth_method = auth
@@ -291,7 +292,8 @@ class WebRequest(object):
_logger.info(msg, *params)
raise werkzeug.exceptions.BadRequest(msg % params)
kwargs.update(self.endpoint.arguments)
if self.endpoint_arguments:
kwargs.update(self.endpoint_arguments)
# Backward for 7.0
if self.endpoint.first_arg_is_req: