Skip to content

Commit

Permalink
Find csrf token from form in PUT and PATCH requests. #86
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed Aug 28, 2013
1 parent d94a343 commit 4edbc77
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions flask_wtf/csrf.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ def _csrf_protect():
return

csrf_token = None
if request.method == 'POST':
# DELETE has no form
if request.method in ('POST', 'PUT', 'PATCH'):
csrf_token = request.form.get('csrf_token')
if not csrf_token:
# You can get csrf token from header
Expand Down

0 comments on commit 4edbc77

Please sign in to comment.