Sha256: acd938bcdef87be11e7a6663de4e5d042e38df132be840040df01681ef093ab4

Contents?: true

Size: 471 Bytes

Versions: 17

Compression:

Stored size: 471 Bytes

Contents

# frozen_string_literal: true

require 'grape/middleware/base'

module Grape
  module Middleware
    class Globals < Base
      def before
        request = Grape::Request.new(@env, build_params_with: @options[:build_params_with])
        @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

17 entries across 17 versions & 2 rubygems

Version Path
grape-2.0.0 lib/grape/middleware/globals.rb
grape-1.8.0 lib/grape/middleware/globals.rb
grape-1.7.1 lib/grape/middleware/globals.rb
grape-1.7.0 lib/grape/middleware/globals.rb
grape-1.6.2 lib/grape/middleware/globals.rb
grape-1.6.1 lib/grape/middleware/globals.rb
grape-1.6.0 lib/grape/middleware/globals.rb
grape-1.5.3 lib/grape/middleware/globals.rb
grape-1.5.2 lib/grape/middleware/globals.rb
grape-1.5.1 lib/grape/middleware/globals.rb
grape-1.5.0 lib/grape/middleware/globals.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/grape-1.4.0/lib/grape/middleware/globals.rb
grape-1.4.0 lib/grape/middleware/globals.rb
grape-1.3.3 lib/grape/middleware/globals.rb
grape-1.3.2 lib/grape/middleware/globals.rb
grape-1.3.1 lib/grape/middleware/globals.rb
grape-1.3.0 lib/grape/middleware/globals.rb