From 87528db176215e753f9e220a1a20a3eb4079c839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Tue, 8 Mar 2022 23:46:55 +0000 Subject: [PATCH] Revert "Merge pull request #43209 from mpestov/check-basic-auth-credentials" This reverts commit e4ad4a2234afd23ec4d3c597085d80d175605184. --- .../lib/action_controller/metal/http_authentication.rb | 2 +- actionpack/test/controller/http_basic_authentication_test.rb | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/actionpack/lib/action_controller/metal/http_authentication.rb b/actionpack/lib/action_controller/metal/http_authentication.rb index 648d96fc0ee61..2ad4df5b53ad8 100644 --- a/actionpack/lib/action_controller/metal/http_authentication.rb +++ b/actionpack/lib/action_controller/metal/http_authentication.rb @@ -104,7 +104,7 @@ def authenticate(request, &login_procedure) end def has_basic_credentials?(request) - request.authorization.present? && (auth_scheme(request).downcase == "basic") && user_name_and_password(request).length == 2 + request.authorization.present? && (auth_scheme(request).downcase == "basic") end def user_name_and_password(request) diff --git a/actionpack/test/controller/http_basic_authentication_test.rb b/actionpack/test/controller/http_basic_authentication_test.rb index 8c81f42a76ab6..73524d0443c87 100644 --- a/actionpack/test/controller/http_basic_authentication_test.rb +++ b/actionpack/test/controller/http_basic_authentication_test.rb @@ -112,11 +112,6 @@ def test_encode_credentials_has_no_newline assert_no_match(/\n/, result) end - test "has_basic_credentials? should fail with credentials without colon" do - @request.env["HTTP_AUTHORIZATION"] = "Basic #{::Base64.encode64("David Goliath")}" - assert_not ActionController::HttpAuthentication::Basic.has_basic_credentials?(@request) - end - test "successful authentication with uppercase authorization scheme" do @request.env["HTTP_AUTHORIZATION"] = "BASIC #{::Base64.encode64("lifo:world")}" get :index