mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-14 23:50:43 +00:00
fix(device-pair): reject invalid remote setup URLs
Fail setup-code generation when gateway.remote.url is configured but malformed, instead of falling back to a bind-derived URL and issuing a bootstrap token.
This commit is contained in:
@@ -285,10 +285,11 @@ async function resolveGatewayUrl(
|
||||
}
|
||||
|
||||
const remoteUrlRaw = cfg.gateway?.remote?.url;
|
||||
const remoteUrl =
|
||||
typeof remoteUrlRaw === "string" && remoteUrlRaw.trim()
|
||||
? normalizeUrl(remoteUrlRaw, scheme)
|
||||
: null;
|
||||
const hasRemoteUrl = typeof remoteUrlRaw === "string" && remoteUrlRaw.trim();
|
||||
const remoteUrl = hasRemoteUrl ? normalizeUrl(remoteUrlRaw, scheme) : null;
|
||||
if (hasRemoteUrl && !remoteUrl) {
|
||||
return { error: "Configured gateway.remote.url is invalid." };
|
||||
}
|
||||
if (opts.preferRemoteUrl && remoteUrl) {
|
||||
return { url: remoteUrl, source: "gateway.remote.url" };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user