提交 559d89c5 编写于 作者: A Aaron Patterson

find_routes only use the request, so stop passing env

上级 890e0a97
......@@ -34,7 +34,7 @@ def call(env)
req.path_info = Utils.normalize_path(req.path_info)
find_routes(env, req).each do |match, parameters, route|
find_routes(req).each do |match, parameters, route|
set_params = req.path_parameters
path_info = req.path_info
script_name = req.script_name
......@@ -64,7 +64,7 @@ def call(env)
def recognize(req)
rails_req = request_class.new(req.env)
find_routes(req.env, rails_req).each do |match, parameters, route|
find_routes(rails_req).each do |match, parameters, route|
unless route.path.anchored
req.env['SCRIPT_NAME'] = match.to_s
req.env['PATH_INFO'] = match.post_match.sub(/^([^\/])/, '/\1')
......@@ -104,7 +104,7 @@ def filter_routes(path)
simulator.memos(path) { [] }
end
def find_routes env, req
def find_routes req
routes = filter_routes(req.path_info).concat custom_routes.find_all { |r|
r.path.match(req.path_info)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册