提交 71d0b61f 编写于 作者: A Aaron Patterson

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
上级 feb248ca
......@@ -17,8 +17,8 @@ def initialize(public_path)
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]) }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册