From 8b3f2d8e6258f4133cf10316f72b9750dbe1a108 Mon Sep 17 00:00:00 2001 From: OsamaSayegh Date: Mon, 13 Jul 2020 21:49:48 +0300 Subject: [PATCH] Fix false 404 in logs when visiting /rack-mini-profiler/requests --- lib/mini_profiler/profiler.rb | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/mini_profiler/profiler.rb b/lib/mini_profiler/profiler.rb index 72bbf796..786c005a 100644 --- a/lib/mini_profiler/profiler.rb +++ b/lib/mini_profiler/profiler.rb @@ -308,6 +308,15 @@ def call(env) status, headers, body = @app.call(env) end end + elsif path == '/rack-mini-profiler/requests' + blank_page_html = <<~HTML + + + + + HTML + + status, headers, body = [200, { 'Content-Type' => 'text/html' }, [blank_page_html.dup]] else status, headers, body = @app.call(env) end @@ -364,16 +373,6 @@ def call(env) return client_settings.handle_cookie(self.flamegraph(flamegraph)) end - if path == '/rack-mini-profiler/requests' - blank_page_html = <<~HTML - - - - - HTML - - status, headers, body = [200, { 'Content-Type' => 'text/html' }, [blank_page_html.dup]] - end begin @storage.save(page_struct)