summaryrefslogtreecommitdiff
path: root/docs/ref/contrib
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2014-06-18 14:35:38 -0400
committerTim Graham <timograham@gmail.com>2014-06-18 14:35:38 -0400
commit0be4d64487537fe5fe220cfb8896c4da08bb22a8 (patch)
treeb3f699a5b5d1ffac8e2fd7b2bd376ae5a0ed01cf /docs/ref/contrib
parent87d0a3384cc263fe0df749a28e2fbc1e1240f043 (diff)
Fixed #22859 -- Improved crossDomain technique in CSRF example.
Thanks flisky for the report.
Diffstat (limited to 'docs/ref/contrib')
-rw-r--r--docs/ref/contrib/csrf.txt3
1 files changed, 1 insertions, 2 deletions
diff --git a/docs/ref/contrib/csrf.txt b/docs/ref/contrib/csrf.txt
index b1dd2a0ff0..29fa56de8a 100644
--- a/docs/ref/contrib/csrf.txt
+++ b/docs/ref/contrib/csrf.txt
@@ -186,9 +186,8 @@ jQuery 1.5 and newer in order to replace the ``sameOrigin`` logic above:
return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));
}
$.ajaxSetup({
- crossDomain: false, // obviates need for sameOrigin test
beforeSend: function(xhr, settings) {
- if (!csrfSafeMethod(settings.type)) {
+ if (!csrfSafeMethod(settings.type) && !this.crossDomain) {
xhr.setRequestHeader("X-CSRFToken", csrftoken);
}
}