From 6a6d4161d1923e2e77a82b1fa3dffc642b8e3617 Mon Sep 17 00:00:00 2001 From: yhirose Date: Sun, 14 Dec 2025 14:45:48 -0500 Subject: [PATCH] Removed DigestAuthTest.FromHTTPWatch_Online_HTTPCan --- test/test.cc | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) diff --git a/test/test.cc b/test/test.cc index f695ab0..035f050 100644 --- a/test/test.cc +++ b/test/test.cc @@ -2055,56 +2055,6 @@ TEST(DigestAuthTest, FromHTTPWatch_Online) { } } -#ifndef CPPHTTPLIB_DEFAULT_HTTPBIN -TEST(DigestAuthTest, FromHTTPWatch_Online_HTTPCan) { - auto host = "httpcan.org"; - auto unauth_path = std::string{"/digest-auth/auth/hello/world"}; - auto paths = std::vector{ - "/digest-auth/auth/hello/world/MD5", - "/digest-auth/auth/hello/world/SHA-256", - "/digest-auth/auth/hello/world/SHA-512", - }; - - auto port = 443; - SSLClient cli(host, port); - - { - auto res = cli.Get(unauth_path); - ASSERT_TRUE(res); - EXPECT_EQ(StatusCode::Unauthorized_401, res->status); - } - - { - - cli.set_digest_auth("hello", "world"); - for (const auto &path : paths) { - auto res = cli.Get(path.c_str()); - ASSERT_TRUE(res); - std::string algo(path.substr(path.rfind('/') + 1)); - EXPECT_EQ( - remove_whitespace("{\"algorithm\":\"" + algo + - "\",\"authenticated\":true,\"user\":\"hello\"}\n"), - remove_whitespace(res->body)); - EXPECT_EQ(StatusCode::OK_200, res->status); - } - - cli.set_digest_auth("hello", "bad"); - for (const auto &path : paths) { - auto res = cli.Get(path.c_str()); - ASSERT_TRUE(res); - EXPECT_EQ(StatusCode::Unauthorized_401, res->status); - } - - cli.set_digest_auth("bad", "world"); - for (const auto &path : paths) { - auto res = cli.Get(path.c_str()); - ASSERT_TRUE(res); - EXPECT_EQ(StatusCode::Unauthorized_401, res->status); - } - } -} -#endif - #endif TEST(SpecifyServerIPAddressTest, AnotherHostname_Online) {