Avoid deprecated use of Rack::Request#[] (#386)

Avoid deprecated use of Rack::Request#[] (#386)

diff --git a/lib/mini_profiler/profiler.rb b/lib/mini_profiler/profiler.rb
index b064ada..a779c40 100644
--- a/lib/mini_profiler/profiler.rb
+++ b/lib/mini_profiler/profiler.rb
@@ -84,11 +84,11 @@ module Rack
 
     def serve_results(env)
       request     = Rack::Request.new(env)
-      id          = request[:id]
+      id          = request.params['id']
       page_struct = @storage.load(id)
       unless page_struct
         @storage.set_viewed(user(env), id)
-        id        = ERB::Util.html_escape(request['id'])
+        id        = ERB::Util.html_escape(request.params['id'])
         user_info = ERB::Util.html_escape(user(env))
         return [404, {}, ["Request not found: #{id} - user #{user_info}"]]
       end

GitHub sha: ad9ca849

1 Like