mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-27 08:29:59 +03:00
commit
1b267affd8
|
@ -43,9 +43,8 @@ var csrftoken = window.drf.csrfToken;
|
|||
$.ajaxSetup({
|
||||
beforeSend: function(xhr, settings) {
|
||||
if (!csrfSafeMethod(settings.type) && sameOrigin(settings.url)) {
|
||||
// Send the token to same-origin, relative URLs only.
|
||||
// Send the token only if the method warrants CSRF protection
|
||||
// Using the CSRFToken value acquired earlier
|
||||
/* Send the token to same-origin, relative URLs only.
|
||||
Send the token only if the method warrants CSRF protection using the CSRFToken value acquired earlier*/
|
||||
xhr.setRequestHeader(window.drf.csrfHeaderName, csrftoken);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user