diff options
author | José Valim <jose.valim@gmail.com> | 2010-09-29 20:28:51 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-09-29 20:28:51 +0200 |
commit | d2ea2e1d5f0964866c4e333a4128049df8927d63 (patch) | |
tree | 2d7a65eb3e9d1fb3d824018c5901b7da4309bd37 /actionpack/lib | |
parent | a617f6bc4c0e235d01db743cf88dd21457a36b7f (diff) | |
parent | 6371e5b99f933ebe462784b5272fdf12e9602e5a (diff) | |
download | rails-d2ea2e1d5f0964866c4e333a4128049df8927d63.tar.gz rails-d2ea2e1d5f0964866c4e333a4128049df8927d63.tar.bz2 rails-d2ea2e1d5f0964866c4e333a4128049df8927d63.zip |
Merge remote branch 'miloops/warnings'
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/testing/assertions/response.rb | 8 |
2 files changed, 3 insertions, 7 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 0cb02c5b80..189da138d8 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -349,7 +349,7 @@ module ActionDispatch 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| diff --git a/actionpack/lib/action_dispatch/testing/assertions/response.rb b/actionpack/lib/action_dispatch/testing/assertions/response.rb index 10b122557a..1558c3ae05 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/response.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/response.rb @@ -81,14 +81,10 @@ module ActionDispatch def normalize_argument_to_redirection(fragment) case fragment - when %r{^\w[\w\d+.-]*:.*} + when %r{^\w[A-Za-z\d+.-]*:.*} fragment when String - if fragment =~ %r{^\w[\w\d+.-]*:.*} - fragment - else - @request.protocol + @request.host_with_port + fragment - end + @request.protocol + @request.host_with_port + fragment when :back raise RedirectBackError unless refer = @request.headers["Referer"] refer |