Skip to content

Commit

Permalink
CSRFMiddleware: fail loudly if not added
Browse files Browse the repository at this point in the history
  • Loading branch information
wardi committed Jan 8, 2018
1 parent f0c6c7d commit 368bcc0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions ckan/config/middleware/pylons_app.py
Expand Up @@ -130,11 +130,8 @@ def make_pylons_stack(conf, full_stack=True, static_files=True,
who_parser.remote_user_key
)

try:
from ckanext.security.middleware import CSRFMiddleware
app = CSRFMiddleware(app, config)
except ImportError:
pass
from ckanext.security.middleware import CSRFMiddleware
app = CSRFMiddleware(app, config)
app = SessionMiddleware(app, config)

# Establish the Registry for this application
Expand Down

0 comments on commit 368bcc0

Please sign in to comment.