j
This commit is contained in:
@@ -536,14 +536,16 @@ def discover_services_on_network(
|
||||
path = paths[0]
|
||||
url = f"{scheme}://{host}:{port}{path}"
|
||||
ok, code, payload = _probe_url(url, timeout=timeout, accept_json=accept_json)
|
||||
if ok:
|
||||
if ok or code == 401:
|
||||
hint = None
|
||||
try:
|
||||
# remote_storage_server returns {"status": "ok", ...}
|
||||
if isinstance(payload, dict) and payload.get("status"):
|
||||
if code == 401:
|
||||
hint = "remote_storage" # Most likely
|
||||
elif isinstance(payload, dict) and payload.get("status"):
|
||||
hint = "remote_storage"
|
||||
# hydrus returns {"api_version": ...}
|
||||
if isinstance(payload, dict) and payload.get("api_version"):
|
||||
elif isinstance(payload, dict) and payload.get("api_version"):
|
||||
hint = "hydrus"
|
||||
except Exception:
|
||||
pass
|
||||
@@ -553,7 +555,7 @@ def discover_services_on_network(
|
||||
port=int(port),
|
||||
path=path,
|
||||
url=url,
|
||||
ok=True,
|
||||
ok=(code == 200),
|
||||
status_code=code,
|
||||
payload=payload,
|
||||
service_hint=hint,
|
||||
|
||||
Reference in New Issue
Block a user