aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/http_digest_authentication_test.rb
diff options
context:
space:
mode:
authorCarlhuda <carlhuda@engineyard.com>2010-03-02 18:57:02 -0800
committerCarl Lerche <carllerche@mac.com>2010-03-03 21:23:34 -0800
commit5e0a05b8cb236d285ebb45de006dd3600c69357d (patch)
tree8fd61eaaa83407c6880bd94c9c3d662cf5c28a84 /actionpack/test/controller/http_digest_authentication_test.rb
parentbcfb77782b9d7f28f0c19005da909162e5e27690 (diff)
downloadrails-5e0a05b8cb236d285ebb45de006dd3600c69357d.tar.gz
rails-5e0a05b8cb236d285ebb45de006dd3600c69357d.tar.bz2
rails-5e0a05b8cb236d285ebb45de006dd3600c69357d.zip
Tweak the semantic of various URL related methods of ActionDispatch::Request
Diffstat (limited to 'actionpack/test/controller/http_digest_authentication_test.rb')
-rw-r--r--actionpack/test/controller/http_digest_authentication_test.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/actionpack/test/controller/http_digest_authentication_test.rb b/actionpack/test/controller/http_digest_authentication_test.rb
index 22d2e23de1..6f167fe627 100644
--- a/actionpack/test/controller/http_digest_authentication_test.rb
+++ b/actionpack/test/controller/http_digest_authentication_test.rb
@@ -139,7 +139,7 @@ class HttpDigestAuthenticationTest < ActionController::TestCase
test "authentication request with request-uri that doesn't match credentials digest-uri" do
@request.env['HTTP_AUTHORIZATION'] = encode_credentials(:username => 'pretty', :password => 'please')
- @request.env['REQUEST_URI'] = "/http_digest_authentication_test/dummy_digest/altered/uri"
+ @request.env['PATH_INFO'] = "/http_digest_authentication_test/dummy_digest/altered/uri"
get :display
assert_response :unauthorized
@@ -148,7 +148,8 @@ class HttpDigestAuthenticationTest < ActionController::TestCase
test "authentication request with absolute request uri (as in webrick)" do
@request.env['HTTP_AUTHORIZATION'] = encode_credentials(:username => 'pretty', :password => 'please')
- @request.env['REQUEST_URI'] = "http://test.host/http_digest_authentication_test/dummy_digest"
+ @request.env["SERVER_NAME"] = "test.host"
+ @request.env['PATH_INFO'] = "/http_digest_authentication_test/dummy_digest"
get :display
@@ -171,7 +172,8 @@ class HttpDigestAuthenticationTest < ActionController::TestCase
test "authentication request with absolute uri in both request and credentials (as in Webrick with IE)" do
@request.env['HTTP_AUTHORIZATION'] = encode_credentials(:url => "http://test.host/http_digest_authentication_test/dummy_digest",
:username => 'pretty', :password => 'please')
- @request.env['REQUEST_URI'] = "http://test.host/http_digest_authentication_test/dummy_digest"
+ @request.env['SERVER_NAME'] = "test.host"
+ @request.env['PATH_INFO'] = "/http_digest_authentication_test/dummy_digest"
get :display
@@ -226,7 +228,7 @@ class HttpDigestAuthenticationTest < ActionController::TestCase
credentials = decode_credentials(@response.headers['WWW-Authenticate'])
credentials.merge!(options)
- credentials.merge!(:uri => @request.env['REQUEST_URI'].to_s)
+ credentials.merge!(:uri => @request.env['PATH_INFO'].to_s)
ActionController::HttpAuthentication::Digest.encode_credentials(method, credentials, password, options[:password_is_ha1])
end