CSRF verification failure now returns HTTP 403 Forbidden, not 200 OK

This commit is contained in:
Marti Raudsepp
2012-11-07 23:20:09 +02:00
committed by Magnus Hagander
parent 6008f93843
commit a923f93b17

View File

@ -152,9 +152,11 @@ def sitemap(request):
@nocache
def csrf_failure(request, reason=''):
return render_to_response('errors/csrf_failure.html', {
resp = render_to_response('errors/csrf_failure.html', {
'reason': reason,
})
resp.status_code = 403 # Forbidden
return resp
# Basic information about the connection
@cache(seconds=30)