We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e857799 commit 7282ed8Copy full SHA for 7282ed8
actionpack/lib/action_controller/response.rb
@@ -30,9 +30,9 @@ def charset
30
31
def redirect(to_url, response_status)
32
self.headers["Status"] = response_status
33
- self.headers["Location"] = to_url
+ self.headers["Location"] = to_url.gsub(/[\r\n]/, '')
34
35
- self.body = "<html><body>You are being <a href=\"#{to_url}\">redirected</a>.</body></html>"
+ self.body = "<html><body>You are being <a href=\"#{CGI.escapeHTML(to_url)}\">redirected</a>.</body></html>"
36
end
37
38
def prepare!
0 commit comments