mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-10-17 10:59:39 +00:00
Fix #2318
This commit is contained in:
1 parent
781c55f120
commit
23a1d79a66
2 files changed
+27
-8
No files matched your search
@@ -14086,3 +14086,18 @@ TEST_F(SSEIntegrationTest, LastEventIdSentOnReconnect) {
|
||||
EXPECT_EQ(received_last_event_ids[1], "event-0");
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Issue2318Test, EmptyHostString) {
|
||||
{
|
||||
httplib::Client cli_empty("", PORT);
|
||||
auto res = cli_empty.Get("/");
|
||||
ASSERT_FALSE(res);
|
||||
EXPECT_EQ(httplib::Error::Connection, res.error());
|
||||
}
|
||||
{
|
||||
httplib::Client cli(" ", PORT);
|
||||
auto res = cli.Get("/");
|
||||
ASSERT_FALSE(res);
|
||||
EXPECT_EQ(httplib::Error::Connection, res.error());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user