summaryrefslogtreecommitdiffstats
path: root/keystone/common
diff options
context:
space:
mode:
authorDolph Mathews <dolph.mathews@gmail.com>2012-02-28 00:08:07 -0600
committerDolph Mathews <dolph.mathews@gmail.com>2012-02-28 00:08:16 -0600
commita7c8e2ab8186a01009a163e4c714ebec95e3cc4e (patch)
tree3918188e90ff968f6b823404d2752dd663e875f5 /keystone/common
parent9581809f88b953e361ef3451d410e568b606fcca (diff)
Provide request to Middleware.process_response()
It appears that no middleware has taken advantage of the builtin process_response(response) convention, because a reference to the original request is typically necessary to build an appropriate response. Change-Id: If032261974eb1d756abdbd5b18892091978e2a07
Diffstat (limited to 'keystone/common')
-rw-r--r--keystone/common/wsgi.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/keystone/common/wsgi.py b/keystone/common/wsgi.py
index c75339f5..6279d4cc 100644
--- a/keystone/common/wsgi.py
+++ b/keystone/common/wsgi.py
@@ -260,7 +260,7 @@ class Middleware(Application):
def __init__(self, application):
self.application = application
- def process_request(self, req):
+ def process_request(self, request):
"""Called on each request.
If this returns None, the next application down the stack will be
@@ -270,17 +270,17 @@ class Middleware(Application):
"""
return None
- def process_response(self, response):
- """Do whatever you'd like to the response."""
+ def process_response(self, request, response):
+ """Do whatever you'd like to the response, based on the request."""
return response
@webob.dec.wsgify(RequestClass=Request)
- def __call__(self, req):
- response = self.process_request(req)
+ def __call__(self, request):
+ response = self.process_request(request)
if response:
return response
- response = req.get_response(self.application)
- return self.process_response(response)
+ response = request.get_response(self.application)
+ return self.process_response(request, response)
class Debug(Middleware):