From 395e9e7ccfe7606d7e4070ca867d7d5a3037fa16 Mon Sep 17 00:00:00 2001 From: NewEraCracker Date: Tue, 22 Mar 2016 15:25:33 +0000 Subject: [PATCH] Import fix for ezyang#6 Thanks to @webbird --- csrf-magic.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/csrf-magic.js b/csrf-magic.js index 1476177..0989c10 100644 --- a/csrf-magic.js +++ b/csrf-magic.js @@ -87,6 +87,10 @@ CsrfMagic.prototype._updateProps = function() { } } CsrfMagic.process = function(base) { + if(typeof base == 'object') { + base[csrfMagicName] = csrfMagicToken; + return base; + } var prepend = csrfMagicName + '=' + csrfMagicToken; if (base) return prepend + '&' + base; return prepend;