check unauthenticated gateway boundary
This commit is contained in:
1 parent
5652a52998
commit
a332add96f
1 file changed
+4
@@ -97,6 +97,10 @@ def main() -> int:
|
||||
status, raw = request(f"{root}{path}", timeout=args.timeout)
|
||||
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:
|
||||
print("未设置 MOYI_API_KEY;只完成公开健康检查。", file=sys.stderr)
|
||||
return 0
|
||||
|
||||
Reference in new issue
Block a user