1
0
Fork 0
forked from 0x2620/oxjs

add Ox.Cookie, send X-CSRFToken if csrftoken cookie is set

This commit is contained in:
j 2013-03-16 17:24:43 +05:30
commit 852641335d
2 changed files with 26 additions and 0 deletions

View file

@ -136,6 +136,12 @@ Ox.Request = (function() {
} else {
pending[options.id] = true;
$.ajax({
beforeSend: function (request) {
var csrftoken = Ox.Cookies('csrftoken');
if (csrftoken) {
request.setRequestHeader("X-CSRFToken", csrftoken);
}
},
complete: complete,
data: options.data,
//dataType: 'json',