Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace localhost with 127.0.0.1 for temporary HttpAgent host #512

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading