提交 152580ee 编写于 作者: E Emilio Tagua

Don't try to interpolate string if there's no interpolation point at all.

上级 bc0e7f4e
......@@ -349,7 +349,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| params.empty? ? path : (path % params) }
path_proc = path.is_a?(Proc) ? path : proc { |params| (params.empty? || !path.match(/%{\w*}/)) ? 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.
先完成此消息的编辑!
想要评论请 注册