Skip to content

Commit

Permalink
Whoops: RMP fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Nate Berkopec committed Dec 5, 2023
1 parent fc3e215 commit a6d227b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions lib/mini_profiler.rb
Expand Up @@ -134,7 +134,6 @@ def user(env)
@config.user_provider.call(env)
end


def current
MiniProfiler.current
end
Expand Down Expand Up @@ -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?
Expand Down
6 changes: 3 additions & 3 deletions lib/mini_profiler/actions.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Rack
class MiniProfiler
module Actions
Expand Down Expand Up @@ -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']
Expand Down Expand Up @@ -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

3 changes: 1 addition & 2 deletions lib/mini_profiler/views.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Rack
class MiniProfiler
module Views
Expand Down Expand Up @@ -84,7 +85,6 @@ def get_profile_script(env)
script
end


BLANK_PAGE = <<~HTML
<!DOCTYPE html>
<html>
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a6d227b

Please sign in to comment.