From c24644f77e6c02bf475c40301b12a71fe5208736 Mon Sep 17 00:00:00 2001 From: Ryan Vandersmith Date: Mon, 22 Jan 2024 12:01:05 -0700 Subject: [PATCH] Replace 'localhost' with '127.0.0.1' for temporary HttpAgent host (#512) --- tools/ui/Cargo.lock | 6 ++---- tools/ui/src/candid.ts | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/ui/Cargo.lock b/tools/ui/Cargo.lock index 43aceb40..1b28c78d 100644 --- a/tools/ui/Cargo.lock +++ b/tools/ui/Cargo.lock @@ -117,7 +117,7 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "candid" -version = "0.10.0" +version = "0.10.2" dependencies = [ "anyhow", "binread", @@ -415,14 +415,12 @@ checksum = "a54b5297861c651551676e8c43df805dad175cc33bc97dbd992edbbb85dcbcdf" [[package]] name = "ic_principal" -version = "0.1.0" +version = "0.1.1" dependencies = [ "arbitrary", "crc32fast", "data-encoding", - "hex", "serde", - "serde_bytes", "sha2", "thiserror", ] diff --git a/tools/ui/src/candid.ts b/tools/ui/src/candid.ts index 0474ab77..24f5f7f9 100644 --- a/tools/ui/src/candid.ts +++ b/tools/ui/src/candid.ts @@ -20,7 +20,9 @@ function isKnownMainnet(agent: HttpAgent) { export let authClient: AuthClient | undefined; -const agent = new HttpAgent({ host: window.location.host }); +const agent = new HttpAgent({ + host: window.location.host.replace(/^(localhost)(:\d+)?$/, '127.0.0.1$2') +}); if (!isKnownMainnet(agent)) { agent.fetchRootKey(); }