mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-12 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:
@@ -222,6 +222,24 @@ describe("pairing setup code", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("rejects invalid gateway.remote.url before falling back to bind-derived setup urls", async () => {
|
||||
await expectResolvedSetupFailureCase({
|
||||
config: {
|
||||
gateway: {
|
||||
bind: "custom",
|
||||
customBindHost: "127.0.0.1",
|
||||
remote: { url: "http://localhost:notaport" },
|
||||
auth: { mode: "token", token: "tok_123" },
|
||||
},
|
||||
},
|
||||
options: {
|
||||
preferRemoteUrl: true,
|
||||
},
|
||||
expectedError: "Configured gateway.remote.url is invalid.",
|
||||
});
|
||||
expect(issueDeviceBootstrapTokenMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it.each([
|
||||
"localhost:notaport",
|
||||
"http://localhost:notaport",
|
||||
|
||||
Reference in New Issue
Block a user