Skip to content

Commit

Permalink
Merge pull request #139 from devin60070/patch-1
Browse files Browse the repository at this point in the history
Update csrf.rst
  • Loading branch information
lepture committed Aug 26, 2014
2 parents 79dd8ae + 3fb7fe5 commit 5498c7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/csrf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Whenever you send a AJAX POST request, add the ``X-CSRFToken`` for it:

$.ajaxSetup({
beforeSend: function(xhr, settings) {
if (!/^(GET|HEAD|OPTIONS|TRACE)$/i.test(settings.type)) {
if (!/^(GET|HEAD|OPTIONS|TRACE)$/i.test(settings.type) && !this.crossDomain) {
xhr.setRequestHeader("X-CSRFToken", csrftoken)
}
}
Expand Down

0 comments on commit 5498c7c

Please sign in to comment.