Update csrf.js

improved comment readability
This commit is contained in:
Russell Quaicoo 2022-05-07 16:13:36 +00:00 committed by GitHub
parent cdc956a96c
commit 7c895c0b45
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);
}
}