#361: Don't test for CSRF token if we're running unit tests.
This commit is contained in:
parent
5d2abe45b2
commit
7e694e5fd8
@ -77,7 +77,10 @@ class CsrfMiddleware(object):
|
||||
# if this is a non-"safe" request (ie, one that could have
|
||||
# side effects), confirm that the CSRF tokens are present and
|
||||
# valid
|
||||
if request.method not in self.SAFE_HTTP_METHODS:
|
||||
if request.method not in self.SAFE_HTTP_METHODS \
|
||||
and ('gmg.verify_csrf' in request.environ or
|
||||
'paste.testing' not in request.environ):
|
||||
|
||||
return self.verify_tokens(request)
|
||||
|
||||
def process_response(self, request, response):
|
||||
|
Loading…
x
Reference in New Issue
Block a user