Project

General

Profile

« Previous | Next » 

Revision 212b8250

Added by Chris Peters over 8 years ago

Fixes #12311 - Fix issue with failed initialization of rack openid middleware.

This fix is for rails4 but is backwards compatible with rails3

When placed in a rails initializer the rack middleware fails to
load, throwing a can't modify frozen array error. Moving the
initialization to the application config resolves this issue.

View differences:

config/application.rb
# enables JSONP support in the Rack middleware
config.middleware.use Rack::JSONP if SETTINGS[:support_jsonp]
# Enable Rack OpenID middleware
begin
require 'rack/openid'
require 'openid/store/filesystem'
openid_store_path = Pathname.new(Rails.root).join('db').join('openid-store')
config.middleware.use Rack::OpenID, OpenID::Store::Filesystem.new(openid_store_path)
rescue LoadError
nil
end
# Enable the asset pipeline
config.assets.enabled = true
config/initializers/rack_openid.rb
begin
require 'rack/openid'
require 'openid/store/filesystem'
openid_store_path = Pathname.new(Rails.root).join('db').join('openid-store')
Rails.configuration.middleware.use Rack::OpenID, OpenID::Store::Filesystem.new(openid_store_path)
rescue LoadError
nil
end

Also available in: Unified diff