3

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.

Rami GB
  • 789
  • 1
  • 8
  • 19

2 Answers2

3

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?

Vlad Khomich
  • 5,820
  • 1
  • 27
  • 39
  • 1
    Yes thank you now the tokens are identical but the problem remains! any tips on where should i look? – Rami GB Sep 29 '11 at 21:41
0

...had the same problem in Rails 3.2.9 but in my case the reason was that I was using this middleware which is ment for Rails 3.0 , once I removed it it was working

equivalent8
  • 13,754
  • 8
  • 81
  • 109