From 646dbfec4abbfa8605efa932195f3473f2f412ea Mon Sep 17 00:00:00 2001 From: Andre Meij Date: Wed, 31 Jul 2024 17:02:20 +0000 Subject: [PATCH] Fix compatiblity with Grape 2.1 --- lib/grape/middleware/logger.rb | 2 +- spec/factories.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/grape/middleware/logger.rb b/lib/grape/middleware/logger.rb index 3c63f40..1fa18c1 100644 --- a/lib/grape/middleware/logger.rb +++ b/lib/grape/middleware/logger.rb @@ -93,7 +93,7 @@ def after_failure(error) 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) diff --git a/spec/factories.rb b/spec/factories.rb index b17fab8..36ad78a 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -45,7 +45,7 @@ def call(_env) 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