Skip to content

Commit

Permalink
cleaning up
Browse files Browse the repository at this point in the history
  • Loading branch information
krpeacock committed Aug 25, 2023
1 parent 7d7a8c8 commit d41f5c3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
1 change: 0 additions & 1 deletion packages/agent/src/agent/http/http.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,6 @@ test('should fetch with given call options and fetch options', async () => {
describe('default host', () => {
it('should use a default host of icp-api.io', () => {
const agent = new HttpAgent({ fetch: jest.fn() });
window.location.hostname; //?
expect((agent as any)._host.hostname).toBe('icp-api.io');
});
it('should use a default of icp-api.io if location is not available', () => {
Expand Down
3 changes: 0 additions & 3 deletions packages/agent/src/agent/http/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,11 @@ export class HttpAgent implements Agent {
// Mainnet and local will have the api route available
const knownHosts = ['ic0.app', 'icp0.io', 'localhost', '127.0.0.1'];
const knownHost = knownHosts.find(host => location?.hostname.endsWith(host));
location;
if (location && knownHost) {
// If the user is on a boundary-node provided host, we can use the same host for the agent
knownHost;
this._host = new URL(
`${location.protocol}//${knownHost}${location.port ? ':' + location.port : ''}`,
);
this._host; //?
} else {
this._host = new URL('https://icp-api.io');
console.warn(
Expand Down

0 comments on commit d41f5c3

Please sign in to comment.