##// END OF EJS Templates
auth: use pyramid HTTP excetion when detecting CSRF error. It helps catching this...
marcink -
r1310:e32790fb default
parent child Browse files
Show More
@@ -35,6 +35,7 b' import traceback'
35 from functools import wraps
35 from functools import wraps
36
36
37 import ipaddress
37 import ipaddress
38 from pyramid.httpexceptions import HTTPForbidden
38 from pylons import url, request
39 from pylons import url, request
39 from pylons.controllers.util import abort, redirect
40 from pylons.controllers.util import abort, redirect
40 from pylons.i18n.translation import _
41 from pylons.i18n.translation import _
@@ -1159,7 +1160,7 b' class CSRFRequired(object):'
1159 'REMOTE_ADDR:%s, HEADERS:%s' % (
1160 'REMOTE_ADDR:%s, HEADERS:%s' % (
1160 request, reason, request.remote_addr, request.headers))
1161 request, reason, request.remote_addr, request.headers))
1161
1162
1162 abort(403, detail=csrf_message)
1163 raise HTTPForbidden(explanation=csrf_message)
1163
1164
1164
1165
1165 class LoginRequired(object):
1166 class LoginRequired(object):
General Comments 0
You need to be logged in to leave comments. Login now