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

Allow to include/exclude private domains / effective TLDs without re-initialization, fixes #185 #186

Conversation

sebastian-nagel
Copy link
Contributor

  • add optional flag excludePrivate to getAssignedDomain(...) / getEffectiveTLD(...)
  • remove methods which exclude private eTLD during initialization

@sebastian-nagel sebastian-nagel force-pushed the cc-185-effective-tld-finder-private-domains branch from 6c2c80c to eb5498b Compare November 5, 2017 09:59
if (getInstance().domains.containsKey(hostname)) {
return getInstance().domains.get(hostname);
EffectiveTLD foundTld = getInstance().domains.get(hostname);
if (!excludePrivate || !foundTld.isPrivate) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Very minor nit, but !(excludePrivate && foundTld.isPrivate) is clearer to me.

…initialization, fixes crawler-commons#185

- add optional flag excludePrivate to getAssignedDomain(...) / getEffectiveTLD(...)
- remove methods which exclude private eTLD during initialization
@sebastian-nagel sebastian-nagel force-pushed the cc-185-effective-tld-finder-private-domains branch from eb5498b to ca0fdd4 Compare November 6, 2017 12:39
  for PaidLevelDomain detection
- adapt unit tests: 'de.com' is a private suffix,
  consequently 'xxx.de.com' isn't a PaidLevelDomain
- rebase on master, apply code format
@sebastian-nagel sebastian-nagel force-pushed the cc-185-effective-tld-finder-private-domains branch from ca0fdd4 to f598af8 Compare November 6, 2017 13:03
@sebastian-nagel sebastian-nagel merged commit bde59ff into crawler-commons:master Dec 1, 2017
@sebastian-nagel sebastian-nagel deleted the cc-185-effective-tld-finder-private-domains branch December 1, 2017 09:44
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.

None yet

2 participants