check unauthenticated gateway boundary

This commit is contained in:
wlx committed 2026-09-26 02:44:29 +08:00
1 parent 5652a52998
commit a332add96f
1 file changed
+4
+4
View File
@@ -97,6 +97,10 @@ def main() -> int:
status, raw = request(f"{root}{path}", timeout=args.timeout) status, raw = request(f"{root}{path}", timeout=args.timeout)
print(f"{path}: HTTP {status} {raw.decode('utf-8', 'replace')[:240]}") print(f"{path}: HTTP {status} {raw.decode('utf-8', 'replace')[:240]}")
unauth_status, unauth_raw = request(f"{base}/models", timeout=args.timeout)
unauth_code, unauth_message = decoded_error(unauth_raw)
print(f"/models without key: HTTP {unauth_status} {unauth_code}: {unauth_message}" if unauth_code or unauth_message else f"/models without key: HTTP {unauth_status}")
if not key: if not key:
print("未设置 MOYI_API_KEY;只完成公开健康检查。", file=sys.stderr) print("未设置 MOYI_API_KEY;只完成公开健康检查。", file=sys.stderr)
return 0 return 0