Skip to content

Commit

Permalink
Revert "Merge pull request #43209 from mpestov/check-basic-auth-crede…
Browse files Browse the repository at this point in the history
…ntials"

This reverts commit e4ad4a2.
  • Loading branch information
rafaelfranca committed Mar 8, 2022
1 parent b10c0ff commit 87528db
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
Expand Up @@ -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)
Expand Down
5 changes: 0 additions & 5 deletions actionpack/test/controller/http_basic_authentication_test.rb
Expand Up @@ -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
Expand Down

0 comments on commit 87528db

Please sign in to comment.