Sha256: 60af3eb037456820631f03c407b3ad87ab2c329e7e259c6ac88471d45a72c80f
Contents?: true
Size: 584 Bytes
Versions: 14
Compression:
Stored size: 584 Bytes
Contents
require 'rack/utils' module Uploader 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, 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 end
Version data entries
14 entries across 14 versions & 1 rubygems