Skip to content

Instantly share code, notes, and snippets.

@flagoworld
Created September 26, 2013 19:44
Show Gist options
  • Save flagoworld/6719521 to your computer and use it in GitHub Desktop.
Save flagoworld/6719521 to your computer and use it in GitHub Desktop.
{
beforeSend: function (xhr, s) {
if (Object.prototype.toString.call(s.data).slice(8, -1) != 'FormData') {
s.data = csrfMagicName + '=' + csrfMagicToken + '&' + s.data;
} else {
s.data.append(csrfMagicName, csrfMagicToken);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment