screens-connection #33
|
|
@ -43,12 +43,16 @@ def _cmd_register(args: argparse.Namespace) -> int:
|
||||||
hub_url = args.hub.rstrip("/")
|
hub_url = args.hub.rstrip("/")
|
||||||
url = f"{hub_url}/screens/agents/register"
|
url = f"{hub_url}/screens/agents/register"
|
||||||
body = json.dumps({"name": args.name or ""}).encode()
|
body = json.dumps({"name": args.name or ""}).encode()
|
||||||
|
# Explicit User-Agent: Python's default `Python-urllib/<ver>` is blocked
|
||||||
|
# by Cloudflare's Browser Integrity Check on `riahub.ai` (HTTP 403 code
|
||||||
|
# 1010), so register() never reached the hub. Any non-default UA passes.
|
||||||
req = urllib.request.Request(
|
req = urllib.request.Request(
|
||||||
url,
|
url,
|
||||||
data=body,
|
data=body,
|
||||||
headers={
|
headers={
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"X-API-Key": args.api_key,
|
"X-API-Key": args.api_key,
|
||||||
|
"User-Agent": "ria-agent/0.1 (+https://github.com/RIA-Toolkit/ria-toolkit-oss)",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user