fix(mcp): repair HTTP service startup and simplify settings

This commit is contained in:
二丫讲梵 authored and t8y2 committed 2026-09-27 12:04:10 +08:00
1 parent 2b26c16683
commit 72f8dfeb7c
18 files changed
+62 -70

No files matched your search

+7 -3
View File
@@ -108,9 +108,13 @@ impl RuntimeConfig {
}
let token = http_token_from_environment()?;
let auth = HttpAuth::new(token, allowed_origins.clone(), is_loopback)?;
let allowed_hosts =
if is_loopback { vec!["localhost".into(), "127.0.0.1".into(), "::1".into()] } else { allowed_hosts };
let allowed_hosts = if is_loopback {
// HTTP Host authorities require brackets around IPv6 literals.
vec!["localhost".into(), "127.0.0.1".into(), "[::1]".into()]
} else {
allowed_hosts
};
let auth = HttpAuth::new_with_hosts(Some(token), allowed_hosts.clone(), allowed_origins.clone(), is_loopback)?;
Ok(Self { transport, http: Some(HttpRuntimeConfig { bind_addr, path, auth, allowed_hosts }) })
}