Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

fix(parse): tighten Feishu URL host matching (#2689)

Qin Haojief3af961fc1c0
diff --git a/openviking/parse/accessors/feishu_accessor.py b/openviking/parse/accessors/feishu_accessor.py
index 9b1ebd3e6..bf1fc349b 100644
--- a/openviking/parse/accessors/feishu_accessor.py
+++ b/openviking/parse/accessors/feishu_accessor.py
@@ -273,12 +273,11 @@ class FeishuAccessor(DataAccessor):
def _is_feishu_url(url: str) -> bool:
"""Check if URL is a Feishu/Lark cloud document."""
parsed = urlparse(url)
- host = parsed.hostname or ""
+ host = (parsed.hostname or "").lower().rstrip(".")
path = parsed.path
- is_feishu_domain = (
- host.endswith(".feishu.cn")
- or host.endswith(".larksuite.com")
- or host.endswith(".larkoffice.com")
+ is_feishu_domain = any(
+ host == allowed_host or host.endswith(f".{allowed_host}")
+ for allowed_host in ("feishu.cn", "larksuite.com", "larkoffice.com")
)
has_doc_path = any(
path == f"/{t}" or path.startswith(f"/{t}/") for t in ("docx", "wiki", "sheets", "base")