mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 01:08:27 +00:00
Fix #1607
This commit is contained in:
parent
fe9a1949a6
commit
f1daa5b88b
2 changed files with 49 additions and 17 deletions
20
test/test.cc
20
test/test.cc
|
@ -4693,6 +4693,26 @@ TEST_F(PayloadMaxLengthTest, ExceedLimit) {
|
|||
EXPECT_EQ(200, res->status);
|
||||
}
|
||||
|
||||
TEST(HostAndPortPropertiesTest, NoSSL) {
|
||||
httplib::Client cli("www.google.com", 1234);
|
||||
ASSERT_EQ("www.google.com", cli.host());
|
||||
ASSERT_EQ(1234, cli.port());
|
||||
}
|
||||
|
||||
TEST(HostAndPortPropertiesTest, NoSSLWithSimpleAPI) {
|
||||
httplib::Client cli("www.google.com:1234");
|
||||
ASSERT_EQ("www.google.com", cli.host());
|
||||
ASSERT_EQ(1234, cli.port());
|
||||
}
|
||||
|
||||
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT
|
||||
TEST(HostAndPortPropertiesTest, SSL) {
|
||||
httplib::SSLClient cli("www.google.com");
|
||||
ASSERT_EQ("www.google.com", cli.host());
|
||||
ASSERT_EQ(443, cli.port());
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT
|
||||
TEST(SSLClientTest, UpdateCAStore) {
|
||||
httplib::SSLClient httplib_client("www.google.com");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue