diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-23 17:22:21 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-23 17:22:21 -0700 |
commit | 71d0b61f3a5e894481a67c92a461653f6db21723 (patch) | |
tree | 7162f2e35fade1ac3a38a595f4be1c26239e062f /actionpack/lib | |
parent | feb248ca76de7bd3c1cbb08914d0bba66c5b41be (diff) | |
download | rails-71d0b61f3a5e894481a67c92a461653f6db21723.tar.gz rails-71d0b61f3a5e894481a67c92a461653f6db21723.tar.bz2 rails-71d0b61f3a5e894481a67c92a461653f6db21723.zip |
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
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/public_exceptions.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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]) } |