提交 c82248ea 编写于 作者: A Aaron Patterson

remove more direct `env` mutations

上级 d4e1f58f
......@@ -98,7 +98,9 @@ def assign_parameters(routes, controller_path, action, parameters, generated_pat
set_header 'rack.input', StringIO.new(data)
end
@env["PATH_INFO"] ||= generated_path
get_header("PATH_INFO") do |k|
set_header k, generated_path
end
path_parameters[:controller] = controller_path
path_parameters[:action] = action
......
......@@ -160,7 +160,7 @@ def generate_url(opts)
def setup
super
@controller = TestController.new
@request.env['PATH_INFO'] = nil
@request.delete_header 'PATH_INFO'
@routes = ActionDispatch::Routing::RouteSet.new.tap do |r|
r.draw do
get ':controller(/:action(/:id))'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册