Merge pull request #1 from Rquaicoo/Rquaicoo-patch-1

Update csrf.js
This commit is contained in:
Russell Quaicoo 2022-05-07 16:13:57 +00:00 committed by GitHub
commit 1b267affd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}
}