aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-12-21 05:14:26 -0800
committerJosé Valim <jose.valim@gmail.com>2011-12-21 05:14:26 -0800
commit618cb4429191290b957391c314a55b4d59f381f3 (patch)
treebef72ad2005a08efb4faa6e8192cec506f591420 /actionpack/test/dispatch
parent1f75a1fea12ead1370113ea1be0272667ab7da88 (diff)
parent3131a9379766a735a80220fd2e94cb07791bed9c (diff)
downloadrails-618cb4429191290b957391c314a55b4d59f381f3.tar.gz
rails-618cb4429191290b957391c314a55b4d59f381f3.tar.bz2
rails-618cb4429191290b957391c314a55b4d59f381f3.zip
Merge pull request #4079 from drogus/http_digest_issue
Fix http digest authentication when url ends with `/` or `?`
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r--actionpack/test/dispatch/request_test.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/request_test.rb b/actionpack/test/dispatch/request_test.rb
index 4d805464c2..5b3d38c48c 100644
--- a/actionpack/test/dispatch/request_test.rb
+++ b/actionpack/test/dispatch/request_test.rb
@@ -618,6 +618,30 @@ class RequestTest < ActiveSupport::TestCase
assert_equal "/authenticate?secret", path
end
+ test "original_fullpath returns ORIGINAL_FULLPATH" do
+ request = stub_request('ORIGINAL_FULLPATH' => "/foo?bar")
+
+ path = request.original_fullpath
+ assert_equal "/foo?bar", path
+ end
+
+ test "original_url returns url built using ORIGINAL_FULLPATH" do
+ request = stub_request('ORIGINAL_FULLPATH' => "/foo?bar",
+ 'HTTP_HOST' => "example.org",
+ 'rack.url_scheme' => "http")
+
+ url = request.original_url
+ assert_equal "http://example.org/foo?bar", url
+ end
+
+ test "original_fullpath returns fullpath if ORIGINAL_FULLPATH is not present" do
+ request = stub_request('PATH_INFO' => "/foo",
+ 'QUERY_STRING' => "bar")
+
+ path = request.original_fullpath
+ assert_equal "/foo?bar", path
+ end
+
protected
def stub_request(env = {})