From 47b4fa4a621ee48ab17545b1e9fb38efef53b28e Mon Sep 17 00:00:00 2001 From: Seth Fitzsimmons Date: Thu, 30 Oct 2008 12:03:47 -0700 Subject: Fixed regex in redirect_to to fully support URI schemes [#1247 state:committed] Signed-off-by: David Heinemeier Hansson --- actionpack/lib/action_controller/base.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_controller/base.rb') 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) -- cgit v1.2.3