提交 986bad6a 编写于 作者: E Emilio Tagua

Remove warning "too many arguments for format string" when interpolating with empty hash.

上级 b9fa46ca
......@@ -350,7 +350,7 @@ def redirect(*args, &block)
options = args.last.is_a?(Hash) ? args.pop : {}
path = args.shift || block
path_proc = path.is_a?(Proc) ? path : proc { |params| path % params }
path_proc = path.is_a?(Proc) ? path : proc { |params| params.empty? ? path : (path % params) }
status = options[:status] || 301
lambda do |env|
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册