Skip to content

Commit 306d874

Browse files
grypezclaude
andauthored
fix(evm-wallet-experiment): use URL.hostname in integration test allo… (#946)
…wedHosts URL.host includes the port ('127.0.0.1:PORT') but makeHostCaveat checks URL.hostname which strips the port. Same regression as the docker e2e fix in #945 <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: a test-only change that corrects hostname/port handling to prevent false allowlist failures. > > **Overview** > Updates the OpenClaw wallet plugin integration test to derive `allowedHosts` from `URL.hostname` instead of `URL.host`, avoiding inclusion of the ephemeral RPC server port so host allowlisting matches the production hostname check. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 1d133fd. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent d93dc41 commit 306d874

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/evm-wallet-experiment/test/integration/openclaw-plugin.integration.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ exec "${process.execPath}" "${ocapCliEntrypoint}" "$@"
233233
throw new Error('Failed to start test RPC server');
234234
}
235235
rpcUrl = `http://127.0.0.1:${String(address.port)}`;
236-
const allowedRpcHost = new URL(rpcUrl).host;
236+
const allowedRpcHost = new URL(rpcUrl).hostname;
237237

238238
await runOcap(['daemon', 'start']);
239239
const launchResponse = (await runOcapJson([

0 commit comments

Comments
 (0)