Skip to content

Improve detection of non-sharable domains#216

Open
philipp-classen wants to merge 1 commit into
mainfrom
static_checks_to_eliminate_known_local_networks
Open

Improve detection of non-sharable domains#216
philipp-classen wants to merge 1 commit into
mainfrom
static_checks_to_eliminate_known_local_networks

Conversation

@philipp-classen

Copy link
Copy Markdown
Member

Tweak the detection of special domains that should normally never be shared.

Since this is a static check, it will also work on platforms like Safari, where we cannot emulate a DNS resolution (and thus cannot detect private networks based on their IP).

Comment thread reporting/src/network.js
// public unless proven otherwise.
const entry = this.dns.get(hostname);
return entry?.ip && isLocalIP(entry.ip);
return false;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Subtle change: this used to return "undefined" before. Being also "falsey", it did not make a difference. Only with the tests, it is more explicit.

I thought about even exposing here "undefined" explicitly, but decided against it. Feeling it overall would lead to more confusion than just making the decision here locally.

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.

1 participant