From 71d0b61f3a5e894481a67c92a461653f6db21723 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Sun, 23 Aug 2015 17:22:21 -0700 Subject: use `Request#path_info` instead of direct ENV access we already have a request, so we should use the methods on the request to access the path info information --- actionpack/lib/action_dispatch/middleware/public_exceptions.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_dispatch') diff --git a/actionpack/lib/action_dispatch/middleware/public_exceptions.rb b/actionpack/lib/action_dispatch/middleware/public_exceptions.rb index 7cde76b30e..0f27984550 100644 --- a/actionpack/lib/action_dispatch/middleware/public_exceptions.rb +++ b/actionpack/lib/action_dispatch/middleware/public_exceptions.rb @@ -17,8 +17,8 @@ module ActionDispatch end def call(env) - status = env["PATH_INFO"][1..-1].to_i request = ActionDispatch::Request.new(env) + status = request.path_info[1..-1].to_i content_type = request.formats.first body = { :status => status, :error => Rack::Utils::HTTP_STATUS_CODES.fetch(status, Rack::Utils::HTTP_STATUS_CODES[500]) } -- cgit v1.2.3