Fix compatiblity with Grape 2.1
This commit is contained in:
parent
ca754ca6c9
commit
646dbfec4a
|
@ -93,7 +93,7 @@ class Grape::Middleware::Logger < Grape::Middleware::Globals
|
||||||
|
|
||||||
def parameters
|
def parameters
|
||||||
request_params = env[Grape::Env::GRAPE_REQUEST_PARAMS].to_hash
|
request_params = env[Grape::Env::GRAPE_REQUEST_PARAMS].to_hash
|
||||||
request_params.merge! env[Grape::Env::RACK_REQUEST_FORM_HASH] if env[Grape::Env::RACK_REQUEST_FORM_HASH]
|
request_params.merge! env[Rack::RACK_REQUEST_FORM_HASH] if env[Rack::RACK_REQUEST_FORM_HASH]
|
||||||
request_params.merge! env['action_dispatch.request.request_parameters'] if env['action_dispatch.request.request_parameters']
|
request_params.merge! env['action_dispatch.request.request_parameters'] if env['action_dispatch.request.request_parameters']
|
||||||
if @options[:filter]
|
if @options[:filter]
|
||||||
@options[:filter].filter(request_params)
|
@options[:filter].filter(request_params)
|
||||||
|
|
|
@ -45,7 +45,7 @@ FactoryGirl.define do
|
||||||
Grape::Env::GRAPE_REQUEST => grape_request,
|
Grape::Env::GRAPE_REQUEST => grape_request,
|
||||||
Grape::Env::GRAPE_REQUEST_PARAMS => params,
|
Grape::Env::GRAPE_REQUEST_PARAMS => params,
|
||||||
Grape::Env::GRAPE_REQUEST_HEADERS => headers,
|
Grape::Env::GRAPE_REQUEST_HEADERS => headers,
|
||||||
Grape::Env::RACK_REQUEST_FORM_HASH => post_params,
|
Rack::RACK_REQUEST_FORM_HASH => post_params,
|
||||||
Grape::Env::API_ENDPOINT => grape_endpoint
|
Grape::Env::API_ENDPOINT => grape_endpoint
|
||||||
).merge(other_env_params)
|
).merge(other_env_params)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue