Skip to content

Commit

Permalink
add csrf protection in js
Browse files Browse the repository at this point in the history
  • Loading branch information
JAMES ZHANG committed Apr 20, 2016
1 parent 4834bc6 commit 25d162f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions public/js/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
* JQuery on ready callback function
*/
function ready() {

// CSRF protection
$.ajaxSetup({
headers: {
'csrf-token': $('meta[name="ct"]').attr('content')
}
});

// load all json data first
$.when(
$.ajax('/data/threshold_v0.1.1.json'),
Expand Down

0 comments on commit 25d162f

Please sign in to comment.