Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
var swfup = new SWFUpload({
post_params : {
authenticity_token : '<%= u form_authenticity_token %>'
session: '<%= u request.env['rack.request.cookie_hash'].try(:[], Rails.application.config.session_options[:key]) %>'
}
});
config.middleware.insert_before ActionDispatch::Session::CookieStore, Rack::FlashSession
require 'rack/utils'
module Rack
class FlashSession
def initialize(app, session_key = Rails.application.config.session_options[:key])
@app = app
@session_key = session_key
end
def call(env)
if env['HTTP_USER_AGENT'] =~ /^(Adobe|Shockwave) Flash/
req = Rack::Request.new(env)
session_data = req.params['session']
if session_data.blank?
log("error, env = #{env.inspect}")
else
env['HTTP_COOKIE'] = [@session_key, session_data].join('=').freeze
env['rack.request.query_hash'].delete('session')
env['rack.request.form_hash'].delete('session')
end
end
@app.call(env)
end
def log(message)
RAILS_DEFAULT_LOGGER.info(message)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.