Sha256: 061f635517e9adbe33a5503472fb3d7e1934128c9bdc9370da6608a69b6ee87c

Contents?: true

Size: 391 Bytes

Versions: 9

Compression:

Stored size: 391 Bytes

Contents

require 'grape/middleware/base'

module Grape
  module Middleware
    class Globals < Base
      def before
        request = Grape::Request.new(@env)
        @env[Grape::Env::GRAPE_REQUEST] = request
        @env[Grape::Env::GRAPE_REQUEST_HEADERS] = request.headers
        @env[Grape::Env::GRAPE_REQUEST_PARAMS] = request.params if @env[Grape::Env::RACK_INPUT]
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
grape-0.19.2 lib/grape/middleware/globals.rb
grape-0.19.1 lib/grape/middleware/globals.rb
grape-0.19.0 lib/grape/middleware/globals.rb
grape-0.18.0 lib/grape/middleware/globals.rb
grape-0.17.0 lib/grape/middleware/globals.rb
grape-0.16.2 lib/grape/middleware/globals.rb
grape-0.16.1 lib/grape/middleware/globals.rb
grape-0.15.0 lib/grape/middleware/globals.rb
grape-0.14.0 lib/grape/middleware/globals.rb