This project is archived and is in readonly mode.
MessageVerifier and Rails 2.3.5 with ruby 1.8.7
Reported by Anthony Underwood | January 7th, 2010 @ 04:50 PM
I have a problem with ruby 1.8.7 and rails 2.3.5 in that whenever a session is initialised I get this error
uninitialized constant ActiveSupport::MessageVerifier::Encoding
This runs out to be a problem in activesupport-2.3.5/lib/active_support/message_verifier.rb
Within the private methods there is this code
# constant-time comparison algorithm to prevent timing attacks def secure_compare(a, b) a = a.dup.force_encoding(Encoding::BINARY) b = b.dup.force_encoding(Encoding::BINARY)
The 'Encoding::BINARY' I think is a ruby 1.9 thing, unfortunately "foo".respond_to?(:force_encoding) returns true for ruby 1.8.7.
I notice on the bleeding edge code on github this code has changed.
Comments and changes to this ticket
- Assigned user set to Ryan Bigg
I was unable to duplicate this issue on 2.3.8:
➜ in ~/code/rails_bugs/message_verifier using ruby-1.8.7-p299 script/console Loading development environment (Rails 2.3.8) ruby-1.8.7-p299 > "foo".respond_to?(:force_encoding) => false
This ticket can be marked as resolved.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>