Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 3.1 authenticity_token + uploadify

I am trying to use Uploadify with my Rails 3.1 app, i've went through all the steps (middleware, initializers, config ...etc) and i think they are all working good but for one thing, my authenticity token is being "evaluated" somewhere in the process and the (+) plus signs are then turned into spaces! .. my original token is

<meta content="GS19lVJNr+/6ghijiM/hNZbo9a89I64nn1Sg+1zbqC8=" name="csrf-token" />

while the one that i see on the console is

"authenticity_token"=>"GS19lVJNr /6ghijiM/hNZbo9a89I64nn1Sg 1zbqC8="

and this of course results in "Cant' verify authenticity token" error and then the request is redirected to elsewhere.

any ideas on that? thank you.

like image 625
Rami GB Avatar asked May 15 '26 12:05

Rami GB


1 Answers

do you encode it?

If you're using something like encodeURIComponent try it like so:

encodeURI(encodeURIComponent(token))

or just try to encode/decode the token right in the firebug/chrome tools to see what's happening

EDIT

that's weird. Can you please show the entire scriptData you're sending?

like image 71
Vlad Khomich Avatar answered May 17 '26 02:05

Vlad Khomich



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!