@dfinity/agent
Advanced tools
Comparing version 0.19.1 to 0.19.2
@@ -159,5 +159,10 @@ "use strict"; | ||
const knownHosts = ['ic0.app', 'icp0.io', 'localhost', '127.0.0.1']; | ||
if (location && knownHosts.includes(location.hostname)) { | ||
const hostname = location === null || location === void 0 ? void 0 : location.hostname; | ||
let knownHost; | ||
if (hostname && typeof hostname === 'string') { | ||
knownHost = knownHosts.find(host => hostname.endsWith(host)); | ||
} | ||
if (location && knownHost) { | ||
// If the user is on a boundary-node provided host, we can use the same host for the agent | ||
this._host = new URL(location + ''); | ||
this._host = new URL(`${location.protocol}//${knownHost}${location.port ? ':' + location.port : ''}`); | ||
} | ||
@@ -164,0 +169,0 @@ else { |
@@ -128,5 +128,10 @@ import { Principal } from '@dfinity/principal'; | ||
const knownHosts = ['ic0.app', 'icp0.io', 'localhost', '127.0.0.1']; | ||
if (location && knownHosts.includes(location.hostname)) { | ||
const hostname = location === null || location === void 0 ? void 0 : location.hostname; | ||
let knownHost; | ||
if (hostname && typeof hostname === 'string') { | ||
knownHost = knownHosts.find(host => hostname.endsWith(host)); | ||
} | ||
if (location && knownHost) { | ||
// If the user is on a boundary-node provided host, we can use the same host for the agent | ||
this._host = new URL(location + ''); | ||
this._host = new URL(`${location.protocol}//${knownHost}${location.port ? ':' + location.port : ''}`); | ||
} | ||
@@ -133,0 +138,0 @@ else { |
{ | ||
"name": "@dfinity/agent", | ||
"version": "0.19.1", | ||
"version": "0.19.2", | ||
"author": "DFINITY Stiftung <sdk@dfinity.org>", | ||
@@ -53,4 +53,4 @@ "license": "Apache-2.0", | ||
"peerDependencies": { | ||
"@dfinity/candid": "^0.19.1", | ||
"@dfinity/principal": "^0.19.1" | ||
"@dfinity/candid": "^0.19.2", | ||
"@dfinity/principal": "^0.19.2" | ||
}, | ||
@@ -57,0 +57,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1082502
8018