提交 c757e9b6 编写于 作者: E eileencodes

Remove `#build_original_fullpath` method

Removing `#build_original_fullpath` because it is no longer
used by the Rails' source code or called in the `#call` method becasue
the previous commit now uses `fullpath` from Rack.

The method was nodoc'ed so it's safe to remove.

NOTE: I did this as a separate commit so if this does cause a problem
with engines etc reverting is easy.
上级 0755d300
......@@ -505,11 +505,6 @@ def default_middleware_stack #:nodoc:
default_stack.build_stack
end
def build_original_fullpath(env) #:nodoc:
req = ActionDispatch::Request.new env
env["ORIGINAL_FULLPATH"] = req.fullpath
end
def validate_secret_key_config! #:nodoc:
if secrets.secret_key_base.blank?
ActiveSupport::Deprecation.warn "You didn't set `secret_key_base`. " +
......
require "abstract_unit"
module ApplicationTests
class BuildOriginalPathTest < ActiveSupport::TestCase
def test_include_original_PATH_info_in_ORIGINAL_FULLPATH
env = { 'PATH_INFO' => '/foo/' }
assert_equal "/foo/", Rails.application.send(:build_original_fullpath, env)
end
def test_include_SCRIPT_NAME
env = {
'SCRIPT_NAME' => '/foo',
'PATH_INFO' => '/bar'
}
assert_equal "/foo/bar", Rails.application.send(:build_original_fullpath, env)
end
def test_include_QUERY_STRING
env = {
'PATH_INFO' => '/foo',
'QUERY_STRING' => 'bar',
}
assert_equal "/foo?bar", Rails.application.send(:build_original_fullpath, env)
end
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册