documentcloud/backbone — pull request #1756 by mlowicki (2012-10-19 19:03:36+00:00)
Title: Call 'beforeSend' function set with $.ajaxSetup when Backbone.emulateHTT...

...P is set to true.

Previously if we set:

Backbone.emulateHTTP = true;

and 'beforeSend' on $.ajax via:

$.ajaxSetup({
beforeSend: function (xhr) {
xhr.setRequestHeader('X-CSRFToken', $.cookie('csrftoken'));
}
});

Then 'beforeSend' won't be called on xhr requests.