Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…all.
  • Loading branch information...
commit 152580ee00205b42de45950d69349c6eab6dd291 1 parent bc0e7f4
@miloops miloops authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  actionpack/lib/action_dispatch/routing/mapper.rb
View
2  actionpack/lib/action_dispatch/routing/mapper.rb
@@ -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|
Please sign in to comment.
Something went wrong with that request. Please try again.