From a6d227bd4ebe49d654297a2e7e4de6dbe9204a69 Mon Sep 17 00:00:00 2001 From: Nate Berkopec Date: Wed, 6 Dec 2023 08:06:11 +0900 Subject: [PATCH] Whoops: RMP fix --- lib/mini_profiler.rb | 3 +-- lib/mini_profiler/actions.rb | 6 +++--- lib/mini_profiler/views.rb | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/mini_profiler.rb b/lib/mini_profiler.rb index 6c50688f..994e453a 100644 --- a/lib/mini_profiler.rb +++ b/lib/mini_profiler.rb @@ -134,7 +134,6 @@ def user(env) @config.user_provider.call(env) end - def current MiniProfiler.current end @@ -208,7 +207,7 @@ def call(env) return serve_flamegraph(env) end - return client_settings.handle_cookie(serve_file(env, file_name: file_name)) + return client_settings.handle_cookie(serve_file(env, file_name: file_name)) end has_disable_cookie = client_settings.disable_profiling? diff --git a/lib/mini_profiler/actions.rb b/lib/mini_profiler/actions.rb index 46019ec8..f53a084a 100644 --- a/lib/mini_profiler/actions.rb +++ b/lib/mini_profiler/actions.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Rack class MiniProfiler module Actions @@ -57,7 +58,7 @@ def serve_file(env, file_name:) rack_file = Rack::File.new(resources_root, 'Cache-Control' => "max-age=#{cache_control_value}") rack_file.call(resources_env) end - + def serve_results(env) request = Rack::Request.new(env) id = request.params['id'] @@ -144,9 +145,8 @@ def serve_profile_memory(env, client_settings) body.close if body.respond_to? :close end report.pretty_print(result) - return client_settings.handle_cookie(text_result(result.string)) + client_settings.handle_cookie(text_result(result.string)) end end end end - diff --git a/lib/mini_profiler/views.rb b/lib/mini_profiler/views.rb index b9e82a52..bfc255d1 100644 --- a/lib/mini_profiler/views.rb +++ b/lib/mini_profiler/views.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Rack class MiniProfiler module Views @@ -84,7 +85,6 @@ def get_profile_script(env) script end - BLANK_PAGE = <<~HTML @@ -135,7 +135,6 @@ def flamegraph(graph, path, env) [200, headers, [html]] end - def help(client_settings, env) headers = { 'Content-Type' => 'text/html' } html = <<~HTML