Fix compatiblity with Grape 2.1

This commit is contained in:
Andre Meij 2024-07-31 17:02:20 +00:00
parent ca754ca6c9
commit 646dbfec4a
2 changed files with 2 additions and 2 deletions

View File

@ -93,7 +93,7 @@ class Grape::Middleware::Logger < Grape::Middleware::Globals
def parameters
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']
if @options[:filter]
@options[:filter].filter(request_params)

View File

@ -45,7 +45,7 @@ FactoryGirl.define do
Grape::Env::GRAPE_REQUEST => grape_request,
Grape::Env::GRAPE_REQUEST_PARAMS => params,
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
).merge(other_env_params)
end