Sha256: 75df705703bd0a5ca8661a936acc507a8041c27fcee5fa4a0c0b35ddbf478cc5

Contents?: true

Size: 505 Bytes

Versions: 22

Compression:

Stored size: 505 Bytes

Contents

require 'rack/utils'

module Ckeditor
  class Middleware
    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::Utils.parse_query(env['QUERY_STRING'])
        env['HTTP_COOKIE'] = [ @session_key, ::Rack::Utils.escape(params[@session_key]) ].join('=').freeze unless params[@session_key].nil?
      end
      @app.call(env)
    end
  end
end

Version data entries

22 entries across 22 versions & 5 rubygems

Version Path
ckeditor-3.5.3 lib/ckeditor/middleware.rb
ckeditor-3.5.2 lib/ckeditor/middleware.rb
ckeditor-3.5.1 lib/ckeditor/middleware.rb
dust-ckeditor-3.5.0 lib/ckeditor/middleware.rb
hifi-ckeditor-3.5.2 lib/ckeditor/middleware.rb
hifi-ckeditor-3.5.1 lib/ckeditor/middleware.rb
artemk-ckeditor-3.5.5 lib/ckeditor/middleware.rb
ckeditor-jess-3.4.3 lib/ckeditor/middleware.rb
ckeditor-3.5.0 lib/ckeditor/middleware.rb
artemk-ckeditor-3.5.4 lib/ckeditor/middleware.rb
artemk-ckeditor-3.4.4 lib/ckeditor/middleware.rb
artemk-ckeditor-3.4.3 lib/ckeditor/middleware.rb
ckeditor-3.4.3.pre lib/ckeditor/middleware.rb
ckeditor-3.4.3 lib/ckeditor/middleware.rb
ckeditor-3.4.2.pre lib/ckeditor/middleware.rb
ckeditor-3.4.2 lib/ckeditor/middleware.rb
ckeditor-3.4.1.pre lib/ckeditor/middleware.rb
ckeditor-3.4.1 lib/ckeditor/middleware.rb
ckeditor-3.4.0 lib/ckeditor/middleware.rb
ckeditor-3.4.0.pre lib/ckeditor/middleware.rb