Skip to content

Commit

Permalink
There is no param like $.restSetup.csrf, so csrf tokens never sends. …
Browse files Browse the repository at this point in the history
…Fix it.
  • Loading branch information
asan committed May 6, 2011
1 parent caa2df6 commit 16d3aa0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jquery.rest.js
Expand Up @@ -88,7 +88,7 @@

settings.data = settings.data || "";

if ($.restSetup.csrf && !$.isEmptyObject($.restSetup.csrf))
if ($.restSetup.csrfParam && $.restSetup.csrfToken)
if (!/^(get)$/i.test(settings.type))
if (!/(authenticity_token=)/i.test(settings.data)) {
settings.data += (settings.data ? "&" : "") + $.restSetup.csrfParam + '=' + $.restSetup.csrfToken;
Expand Down

0 comments on commit 16d3aa0

Please sign in to comment.