yhirose 2 月之前
父節點
當前提交
84796738fc
共有 1 個文件被更改,包括 8 次插入1 次删除
  1. 8 1
      test/test.cc

+ 8 - 1
test/test.cc

@@ -7618,7 +7618,14 @@ TEST(SNI_AutoDetectionTest, SNI_Logic) {
       SSLClient cli("::1", PORT);
       cli.enable_server_certificate_verification(false);
       auto res = cli.Get("/sni?expected=");
-      ASSERT_TRUE(res);
+
+      // NOTE: This may fail if the server is listening on IPv4 only
+      // (e.g., when localhost resolves to 127.0.0.1 only)
+      if (res) {
+        EXPECT_EQ(StatusCode::OK_200, res->status);
+      } else {
+        EXPECT_EQ(Error::Connection, res.error());
+      }
     }
   }
 }