diff options
| author | Tim Graham <timograham@gmail.com> | 2014-06-18 14:35:38 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-06-18 14:37:19 -0400 |
| commit | 427f218a5ecec315a18583c1013e315d9102d6d3 (patch) | |
| tree | cbac8e82fcfeb35b3aa44252bff97f84ab396cb1 /docs | |
| parent | 807aadaaad317b67965052048b3a2fb92a1aaa79 (diff) | |
[1.7.x] Fixed #22859 -- Improved crossDomain technique in CSRF example.
Thanks flisky for the report.
Backport of 0be4d64487 from master
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/contrib/csrf.txt | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/docs/ref/contrib/csrf.txt b/docs/ref/contrib/csrf.txt index 4c37f7448c..10f1c8807e 100644 --- a/docs/ref/contrib/csrf.txt +++ b/docs/ref/contrib/csrf.txt @@ -190,9 +190,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); } } |
