fix: evaluates subdomains correctly when determining known hosts #757
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: