Issue 680: Dispatch meddleware request processing post-routing

This commit is contained in:
Nathan Yergler
2011-11-26 14:34:36 -08:00
parent e4113ad5b4
commit 91cf67385a
4 changed files with 11 additions and 9 deletions

View File

@@ -25,7 +25,7 @@ class BaseMeddleware(object):
def __init__(self, mg_app):
self.app = mg_app
def process_request(self, request):
def process_request(self, request, controller):
pass
def process_response(self, request, response):

View File

@@ -58,7 +58,7 @@ class CsrfMeddleware(BaseMeddleware):
CSRF_KEYLEN = 64
SAFE_HTTP_METHODS = ("GET", "HEAD", "OPTIONS", "TRACE")
def process_request(self, request):
def process_request(self, request, controller):
"""For non-safe requests, confirm that the tokens are present
and match.
"""

View File

@@ -19,7 +19,8 @@ from mediagoblin.meddleware import BaseMeddleware
class NoOpMeddleware(BaseMeddleware):
def process_request(self, request):
def process_request(self, request, controller):
pass
def process_response(self, request, response):