aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/base/redirect.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/base/redirect.rb')
-rw-r--r--actionpack/lib/action_controller/base/redirect.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/base/redirect.rb b/actionpack/lib/action_controller/base/redirect.rb
index 2e92117e7c..7e10f614e2 100644
--- a/actionpack/lib/action_controller/base/redirect.rb
+++ b/actionpack/lib/action_controller/base/redirect.rb
@@ -48,8 +48,6 @@ module ActionController
status = 302
end
- response.redirected_to = options
-
case options
# The scheme name consist of a letter followed by any combination of
# letters, digits, and the plus ("+"), period ("."), or hyphen ("-")
@@ -72,7 +70,9 @@ module ActionController
def redirect_to_full_url(url, status)
raise DoubleRenderError if performed?
logger.info("Redirected to #{url}") if logger && logger.info?
- response.redirect(url, interpret_status(status))
+ response.status = interpret_status(status)
+ response.location = url.gsub(/[\r\n]/, '')
+ response.body = "<html><body>You are being <a href=\"#{CGI.escapeHTML(url)}\">redirected</a>.</body></html>"
@performed_redirect = true
end
@@ -82,8 +82,6 @@ module ActionController
# The response body is not reset here, see +erase_render_results+
def erase_redirect_results #:nodoc:
@performed_redirect = false
- response.redirected_to = nil
- response.redirected_to_method_params = nil
response.status = DEFAULT_RENDER_STATUS_CODE
response.headers.delete('Location')
end