diff options
author | Seth Fitzsimmons <seth@mojodna.net> | 2008-10-30 12:03:47 -0700 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-10-30 21:07:50 +0100 |
commit | 47b4fa4a621ee48ab17545b1e9fb38efef53b28e (patch) | |
tree | 2cf5c92154ff0cdefb4b09e16cb788802369cb4b /actionpack/lib | |
parent | ef53d915164da7f757d03c4a70fe38e374c08b14 (diff) | |
download | rails-47b4fa4a621ee48ab17545b1e9fb38efef53b28e.tar.gz rails-47b4fa4a621ee48ab17545b1e9fb38efef53b28e.tar.bz2 rails-47b4fa4a621ee48ab17545b1e9fb38efef53b28e.zip |
Fixed regex in redirect_to to fully support URI schemes [#1247 state:committed]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/base.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index 2cff05dfa4..e9429d3bb2 100644 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -1053,7 +1053,10 @@ module ActionController #:nodoc: logger.info("Redirected to #{options}") if logger && logger.info? case options - when %r{^\w+://.*} + # The scheme name consist of a letter followed by any combination of + # letters, digits, and the plus ("+"), period ("."), or hyphen ("-") + # characters; and is terminated by a colon (":"). + when %r{^\w[\w\d+.-]*:.*} redirect_to_full_url(options, status) when String redirect_to_full_url(request.protocol + request.host_with_port + options, status) |