CSRF_HEADER_NAME

- Get CSRF_HEADER_NAME from settings to pass to jquery.django-csrf.html template
- Version bump to 2.1.10
- Update readme
This commit is contained in:
Brandon Taylor
2019-01-14 09:40:54 -05:00
parent b1258afcea
commit c15f307e5a
5 changed files with 26 additions and 15 deletions
@@ -27,7 +27,7 @@
crossDomain: false, // obviates need for sameOrigin test
beforeSend: function(xhr, settings) {
if (!csrfSafeMethod(settings.type)) {
xhr.setRequestHeader("X-CSRFToken", csrftoken);
xhr.setRequestHeader("{{ csrf_header_name }}", csrftoken);
}
}
});