Skip to content

Commit

Permalink
Replace 'localhost' with '127.0.0.1' for temporary HttpAgent host (#512)
Browse files Browse the repository at this point in the history
  • Loading branch information
rvanasa authored Jan 22, 2024
1 parent 8c1161e commit c24644f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 2 additions & 4 deletions tools/ui/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion tools/ui/src/candid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit c24644f

Please sign in to comment.