flash upload should work with any session storage

This commit is contained in:
Espen Antonsen 2011-09-25 14:51:27 +08:00
parent bb3eb2bc13
commit b70757c7a4
2 changed files with 1 additions and 2 deletions

View file

@ -13,7 +13,6 @@ class FlashSessionCookieMiddleware
req.params[@session_key] ].join('=').freeze unless req.params[@session_key].nil? req.params[@session_key] ].join('=').freeze unless req.params[@session_key].nil?
env['HTTP_ACCEPT'] = "#{req.params['_http_accept']}".freeze unless req.params['_http_accept'].nil? env['HTTP_ACCEPT'] = "#{req.params['_http_accept']}".freeze unless req.params['_http_accept'].nil?
end end
@app.call(env) @app.call(env)
end end
end end

View file

@ -3,7 +3,7 @@
Balder::Application.config.session_store :cookie_store, :key => '_balder_session' Balder::Application.config.session_store :cookie_store, :key => '_balder_session'
Rails.application.config.middleware.insert_before( Rails.application.config.middleware.insert_before(
ActionDispatch::Session::CookieStore, Rails.application.config.session_store,
FlashSessionCookieMiddleware, FlashSessionCookieMiddleware,
Rails.application.config.session_options[:key] Rails.application.config.session_options[:key]
) )