aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorArthur Neves <arthurnn@gmail.com>2015-06-17 20:17:44 +0200
committerArthur Neves <arthurnn@gmail.com>2015-06-17 20:17:44 +0200
commitffba8f79a2332398d4848d8987a42567001cbdf4 (patch)
tree312a8a0bd7eb49e781eb2f6f37991521826783f8 /actionpack/lib
parent15de4b6d1edd09dd8b5810d6538012461f4e46b0 (diff)
downloadrails-ffba8f79a2332398d4848d8987a42567001cbdf4.tar.gz
rails-ffba8f79a2332398d4848d8987a42567001cbdf4.tar.bz2
rails-ffba8f79a2332398d4848d8987a42567001cbdf4.zip
Revert "Merge pull request #20584 from arthurnn/fix_url"
This reverts commit 0b3397872582f2cf1bc6960960a6393f477c55e6, reversing changes made to 56d52e3749180e6c1dcf7166adbad967470aa78b. As pointed out on the PR, this will hide development mistakes too, which is not ideal.
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_dispatch/routing/redirection.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/actionpack/lib/action_dispatch/routing/redirection.rb b/actionpack/lib/action_dispatch/routing/redirection.rb
index 8d965a5f8e..3c1c4fadf6 100644
--- a/actionpack/lib/action_dispatch/routing/redirection.rb
+++ b/actionpack/lib/action_dispatch/routing/redirection.rb
@@ -23,12 +23,8 @@ module ActionDispatch
def serve(req)
req.check_path_parameters!
- begin
- uri = URI.parse(path(req.path_parameters, req))
- rescue URI::InvalidURIError
- return [ 400, {}, ['Invalid path.'] ]
- end
-
+ uri = URI.parse(path(req.path_parameters, req))
+
unless uri.host
if relative_path?(uri.path)
uri.path = "#{req.script_name}/#{uri.path}"
@@ -36,7 +32,7 @@ module ActionDispatch
uri.path = req.script_name.empty? ? "/" : req.script_name
end
end
-
+
uri.scheme ||= req.scheme
uri.host ||= req.host
uri.port ||= req.port unless req.standard_port?
@@ -128,7 +124,7 @@ module ActionDispatch
url_options[:script_name] = request.script_name
end
end
-
+
ActionDispatch::Http::URL.url_for url_options
end