1
0
mirror of synced 2025-04-20 11:47:43 +03:00

Add a unit test for Issue #2004

This commit is contained in:
yhirose 2024-12-12 18:15:22 -05:00
parent 258992a160
commit e6d71bd702

View File

@ -6132,6 +6132,18 @@ TEST(SSLClientTest, WildcardHostNameMatch_Online) {
ASSERT_EQ(StatusCode::OK_200, res->status); ASSERT_EQ(StatusCode::OK_200, res->status);
} }
TEST(SSLClientTest, Issue2004) {
Client client("https://google.com");
client.set_follow_location(true);
auto res = client.Get("/");
ASSERT_TRUE(res);
ASSERT_EQ(StatusCode::OK_200, res->status);
auto body = res->body;
EXPECT_EQ(body.substr(0, 15), "<!doctype html>");
}
#if 0 #if 0
TEST(SSLClientTest, SetInterfaceWithINET6) { TEST(SSLClientTest, SetInterfaceWithINET6) {
auto cli = std::make_shared<httplib::Client>("https://httpbin.org"); auto cli = std::make_shared<httplib::Client>("https://httpbin.org");