Sha256: a2b0587b8cfff0428a50b1f234b91ed4627a84d9aec4d046cae145deedade7f4

Contents?: true

Size: 455 Bytes

Versions: 1

Compression:

Stored size: 455 Bytes

Contents

 module Rack
   class ReflectEnv
     def initialize(app, opts = {})
       opts = {:type => 'text/plain'}.merge(opts)
         @type = opts[:type]
         @keys = opts[:keys]
     end
     
     def call(env)
       headers = {}
       headers['Content-Type'] = @type
       env = env.reject {|k,v| !@keys.include?(k)} if @keys
       [200, headers, [env.inspect]]
     end
     
     def self.app(opts = {})
       new(nil, opts)
     end
   end
 end
 

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kissifer-rack-reflect-env-0.1.2 lib/rack/reflect-env.rb