Skip to content

Instantly share code, notes, and snippets.

@vijedi
Created February 8, 2012 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vijedi/1769443 to your computer and use it in GitHub Desktop.
Save vijedi/1769443 to your computer and use it in GitHub Desktop.
Correct CSRF Token
$("body").bind("ajaxSend", function(elm, xhr, s){
if (s.type == "POST" || type == "DELETE" || type == "PUT") {
xhr.setRequestHeader('X-CSRF-Token', Common.CSRF_TOKEN);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment