Permalink
Browse files

Safely check for X-Requested-With in publish code.

  • Loading branch information...
spladug committed Jun 4, 2012
1 parent 3ea7a86 commit 4215a108259bb495e6fe96725d2a79f45e191a66
Showing with 1 addition and 1 deletion.
  1. +1 −1 postcards/views.py
View
@@ -142,7 +142,7 @@ def delete(id):
postcard.deleted = True
db.session.commit()
- if request.headers['X-Requested-With'] == 'XMLHttpRequest':
+ if request.headers.get('X-Requested-With') == 'XMLHttpRequest':
return 'success!'
else:
flash('postcard deleted!')

0 comments on commit 4215a10

Please sign in to comment.