forked from 0x2620/oxjs
add Ox.Cookie, send X-CSRFToken if csrftoken cookie is set
This commit is contained in:
parent
0ba564c104
commit
852641335d
2 changed files with 26 additions and 0 deletions
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue