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

fix: evaluates subdomains correctly when determining known hosts #757

Merged
merged 4 commits into from
Aug 25, 2023

Conversation

krpeacock
Copy link
Contributor

@krpeacock krpeacock commented Aug 25, 2023

Description

With the recent change to the default host in 0.19.1, the parsing logic was incorrectly not handling subdomains or ports correctly when determining whether the agent should use the current location as a host.

This led to applications using a default asset canister configuration to make calls to icp-api.io, which is currently not configured under the content security policy in ic-assets.json.

These changes improve the logic and correctly use the host on local and network deployment when no host is specified.

How Has This Been Tested?

New unit test cases. Also, was manually tested by installing a build to a fresh dfx new project and deploying locally and to mainnet.

Live site: https://rqqdj-jqaaa-aaaab-qaiha-cai.icp0.io/

Checklist:

  • My changes follow the guidelines in CONTRIBUTING.md.
  • The title of this PR complies with Conventional Commits.
  • I have edited the CHANGELOG accordingly.
  • I have made corresponding changes to the documentation.

@krpeacock krpeacock requested a review from a team as a code owner August 25, 2023 17:15
@krpeacock krpeacock changed the title Kyle/hostname bug fix: evaluates subdomains correctly when determining known hosts Aug 25, 2023
@krpeacock krpeacock enabled auto-merge (squash) August 25, 2023 17:17
@github-actions
Copy link
Contributor

github-actions bot commented Aug 25, 2023

size-limit report 📦

Path Size
@dfinity/agent 87.03 KB (+0.05% 🔺)
@dfinity/candid 13.52 KB (0%)
@dfinity/principal 5.15 KB (0%)
@dfinity/auth-client 92.54 KB (0%)
@dfinity/assets 89.56 KB (0%)
@dfinity/identity 89.81 KB (0%)
@dfinity/identity-secp256k1 232.13 KB (+0.03% 🔺)

@krpeacock krpeacock merged commit 2e6584e into main Aug 25, 2023
12 checks passed
@krpeacock krpeacock deleted the kyle/hostname-bug branch August 25, 2023 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants