Sha256: 29ec5573de2e456a58cae7e2417ec94338037ed27e3f38af8e72d98e4936c6cc
Contents?: true
Size: 646 Bytes
Versions: 56
Compression:
Stored size: 646 Bytes
Contents
require 'rack/utils' class FlashSessionCookieMiddleware def initialize(app, session_key = '_session_id') @app = app @session_key = session_key end def call(env) if env['HTTP_USER_AGENT'] =~ /^(Adobe|Shockwave) Flash/ req = Rack::Request.new(env) env['HTTP_COOKIE'] = [ @session_key, ::Rack::Utils.escape(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? end @app.call(env) end end
Version data entries
56 entries across 56 versions & 1 rubygems