Skip to content

Commit

Permalink
Add a unit test for Issue #2004
Browse files Browse the repository at this point in the history
  • Loading branch information
yhirose committed Dec 12, 2024
1 parent 258992a commit e6d71bd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6132,6 +6132,18 @@ TEST(SSLClientTest, WildcardHostNameMatch_Online) {
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
TEST(SSLClientTest, SetInterfaceWithINET6) {
auto cli = std::make_shared<httplib::Client>("https://httpbin.org");
Expand Down

0 comments on commit e6d71bd

Please sign in to comment.