fix: 修复 TLS ConnectionState、SPA 回退、健康检查与监听小问题

This commit is contained in:
Nixevol
2026-09-30 16:22:38 +08:00
parent c0b2903ab7
commit 7c926a0904
17 changed files with 590 additions and 62 deletions
+14
View File
@@ -102,6 +102,20 @@ func TestServeHealthzAndListenAddr(t *testing.T) {
t.Fatalf("readyz status=%d", ready.StatusCode)
}
spa, err := http.Get("http://" + addr + "/endpoints")
if err != nil {
t.Fatalf("spa: %v", err)
}
defer func() { _ = spa.Body.Close() }()
spaBody, _ := io.ReadAll(spa.Body)
if spa.StatusCode != http.StatusOK {
t.Fatalf("spa status=%d body=%s", spa.StatusCode, spaBody)
}
ct := spa.Header.Get("Content-Type")
if !strings.Contains(ct, "text/html") {
t.Fatalf("spa content-type=%q", ct)
}
if _, err := os.Stat(filepath.Join(dataDir, "nixmsg.db")); err != nil {
t.Fatalf("db missing: %v", err)
}