aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/http_basic_authentication_test.rb
diff options
context:
space:
mode:
authorDennis Suratna <dennis.suratna@gmail.com>2015-08-11 15:25:38 -0700
committerDennis Suratna <dennis.suratna@gmail.com>2015-08-11 15:59:44 -0700
commitdec2f52fa494c5adf8805ec227ed60d911a6fb4a (patch)
treeec32e762aad8afbafa55af9e8486c3a4d36355e3 /actionpack/test/controller/http_basic_authentication_test.rb
parent17eb64213a86d14ebe44a1215f2408065fa2634a (diff)
downloadrails-dec2f52fa494c5adf8805ec227ed60d911a6fb4a.tar.gz
rails-dec2f52fa494c5adf8805ec227ed60d911a6fb4a.tar.bz2
rails-dec2f52fa494c5adf8805ec227ed60d911a6fb4a.zip
Authorization scheme should be case insensitive. Fixes #21199
Diffstat (limited to 'actionpack/test/controller/http_basic_authentication_test.rb')
-rw-r--r--actionpack/test/controller/http_basic_authentication_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/test/controller/http_basic_authentication_test.rb b/actionpack/test/controller/http_basic_authentication_test.rb
index ed3632007d..0a5e5402b9 100644
--- a/actionpack/test/controller/http_basic_authentication_test.rb
+++ b/actionpack/test/controller/http_basic_authentication_test.rb
@@ -100,6 +100,14 @@ class HttpBasicAuthenticationTest < ActionController::TestCase
assert_no_match(/\n/, result)
end
+ test "succesful authentication with uppercase authorization scheme" do
+ @request.env['HTTP_AUTHORIZATION'] = "BASIC #{::Base64.encode64("lifo:world")}"
+ get :index
+
+ assert_response :success
+ assert_equal 'Hello Secret', @response.body, 'Authentication failed when authorization scheme BASIC'
+ end
+
test "authentication request without credential" do
get :display