Sha256: 8fb65a880f8f06e0273856f547381b7355c1e5ae512b38520fcbcde241461658

Contents?: true

Size: 439 Bytes

Versions: 24

Compression:

Stored size: 439 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/
      params = ::Rack::Request.new(env).params
      env['HTTP_COOKIE'] = [ @session_key, params[@session_key] ].join('=').freeze unless params[@session_key].nil?
    end
    @app.call(env)
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
papermill-2.1.1 lib/papermill/flash_session_cookie_middleware.rb
papermill-2.1.0 lib/papermill/flash_session_cookie_middleware.rb
papermill-2.0.2 lib/papermill/flash_session_cookie_middleware.rb
papermill-2.0.1 lib/papermill/flash_session_cookie_middleware.rb
papermill-2.0.0 lib/papermill/flash_session_cookie_middleware.rb
papermill-2.0.0.pre lib/papermill/flash_session_cookie_middleware.rb
papermill-1.4.3 lib/papermill/flash_session_cookie_middleware.rb
papermill-1.4.2 lib/papermill/flash_session_cookie_middleware.rb
papermill-1.4.1 lib/papermill/flash_session_cookie_middleware.rb
papermill-1.4.0 lib/papermill/flash_session_cookie_middleware.rb
papermill-1.3.6 lib/papermill/flash_session_cookie_middleware.rb
papermill-1.3.5 lib/papermill/flash_session_cookie_middleware.rb
papermill-1.3.4 lib/papermill/flash_session_cookie_middleware.rb
papermill-1.3.3 lib/papermill/flash_session_cookie_middleware.rb
papermill-1.3.2 lib/papermill/flash_session_cookie_middleware.rb
papermill-1.3.1 lib/papermill/flash_session_cookie_middleware.rb
papermill-1.3.0 lib/papermill/flash_session_cookie_middleware.rb
papermill-1.2.0 lib/papermill/flash_session_cookie_middleware.rb
papermill-1.1.6 lib/papermill/flash_session_cookie_middleware.rb
papermill-1.1.5 lib/papermill/flash_session_cookie_middleware.rb