From e55efbadbd9fe579d854d97d127c46247c94713b Mon Sep 17 00:00:00 2001 From: Marek Date: Sat, 6 Dec 2014 22:29:40 +0000 Subject: [PATCH] Fix assignment instead of comparison of password. This is why some people prefer ``"something" == variable`` comparisons to prevent such a mistakes. --- chapter_10/basic_auth/basic_auth.ru | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter_10/basic_auth/basic_auth.ru b/chapter_10/basic_auth/basic_auth.ru index e0032fa..1f4968b 100644 --- a/chapter_10/basic_auth/basic_auth.ru +++ b/chapter_10/basic_auth/basic_auth.ru @@ -4,6 +4,6 @@ use Rack::Auth::Basic, "Protected Realm" do |username, password| # You could make a request to a user service here to see if the user is correct # For apps that are not externally accessible, it's sometimes easier (though not quite as secure) # to just have a standard username and pass: - username == "bobs_protection" && password = "bobs_sekret_pass" + username == "bobs_protection" && password == "bobs_sekret_pass" end run ProtectedApp.new