From 7c895c0b45b10a3cde1cf611a641c0023f4c3fc7 Mon Sep 17 00:00:00 2001 From: Russell Quaicoo Date: Sat, 7 May 2022 16:13:36 +0000 Subject: [PATCH] Update csrf.js improved comment readability --- rest_framework/static/rest_framework/js/csrf.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rest_framework/static/rest_framework/js/csrf.js b/rest_framework/static/rest_framework/js/csrf.js index 6e4bf39a7..5f6b111e2 100644 --- a/rest_framework/static/rest_framework/js/csrf.js +++ b/rest_framework/static/rest_framework/js/csrf.js @@ -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); } }