Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

Improved url online checking logic (#10206)

pinghe9c703d00162a
diff --git a/kernel/util/net.go b/kernel/util/net.go
index bace9a366f..f681ffd3cc 100644
--- a/kernel/util/net.go
+++ b/kernel/util/net.go
@@ -100,6 +100,11 @@ func isOnline(checkURL string, skipTlsVerify bool) (ret bool) {
for i := 0; i < 3; i++ {
resp, err := c.R().Get(checkURL)
+
+ if resp.StatusCode == 401 {
+ return true
+ }
+
if resp.GetHeader("Location") != "" {
return true
}