Skip to content
Browse files

Revert "Don't remove trailing slash from PATH_INFO for mounted apps"

This should not be treated as a bug fix, because the behavior was
present in Rails for quite some time and some people may rely on it.

This reverts commit 1193a27.
  • Loading branch information...
1 parent 1193a27 commit ad0681a7a83e1bad7cffb6a02ae8545daa326d82 @drogus drogus committed Jun 21, 2013
View
2 actionpack/CHANGELOG.md
@@ -1228,6 +1228,4 @@
* `ActionView::Helpers::TextHelper#highlight` now defaults to the
HTML5 `mark` element. *Brian Cardarella*
-* Fix removing trailing slash for mounted apps #3215 *Piotr Sarnacki*
-
Please check [3-2-stable](https://github.com/rails/rails/blob/3-2-stable/actionpack/CHANGELOG.md) for previous changes.
View
8 actionpack/lib/action_dispatch/journey/router.rb
@@ -54,7 +54,7 @@ def initialize(routes, options)
end
def call(env)
- env['PATH_INFO'] = normalize_path(env['PATH_INFO'])
+ env['PATH_INFO'] = Utils.normalize_path(env['PATH_INFO'])
find_routes(env).each do |match, parameters, route|
script_name, path_info, set_params = env.values_at('SCRIPT_NAME',
@@ -103,12 +103,6 @@ def visualizer
private
- def normalize_path(path)
- path = "/#{path}"
- path.squeeze!('/')
- path
- end
-
def partitioned_routes
routes.partitioned_routes
end
View
5 actionpack/test/dispatch/mount_test.rb
@@ -33,11 +33,6 @@ def app
Router
end
- def test_trailing_slash_is_not_removed_from_path_info
- get "/sprockets/omg/"
- assert_equal "/sprockets -- /omg/", response.body
- end
-
def test_mounting_sets_script_name
get "/sprockets/omg"
assert_equal "/sprockets -- /omg", response.body

0 comments on commit ad0681a

Please sign in to comment.
Something went wrong with that request. Please try again.