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: Fix error where a lot of domains were not detected #65

Merged
merged 2 commits into from May 27, 2019
Merged

fix: Fix error where a lot of domains were not detected #65

merged 2 commits into from May 27, 2019

Conversation

jpstevens
Copy link
Contributor

@jpstevens jpstevens commented Feb 19, 2019

A number of domains were not recognised, due to issues with the separator logic in the trie serializer.

TLDs which didn't work, but now do, are as follows:

niteroi.br / *.nom.br

Changes trie snapshot from niteroinom>* to niteroi,nom>*

police.uk / *.sch.uk

Changes trie snapshot from policesch>* to police,sch>*

budejju.no / nes.buskerud.no

Changes trie snapshot from budejjubuskerud>nes to budejju,buskerud>nes

hønefoss.no / os.hordaland.no

Changes trie snapshot from hønefosshordaland>os to hønefoss,hordaland>os

molde.no / heroy.more-og-romsdal.no

Changes trie snapshot from moldemore-og-romsdal>heroy to molde,more-og-romsdal>heroy

nordkapp.no / bo.nordland.no

Changes trie snapshot from nordkappnordland>bo to nordkapp,nordland>bo

osterøy.no / valer.ostfold.no

Changes trie snapshot from osterøyostfold>valer to osterøy,ostfold>valer

tananger.no / bo.telemark.no

Changes trie snapshot from tanangertelemark>bo to tananger,telemark>bo

vestby.no / sande.vestfold.no

Changes trie snapshot from vestbyvestfold>sande to vestby,vestfold>sande

haugesund.no / os.hedmark.no

Changes trie snapshot from haugesundhedmark>os to haugesund,hedmark>os

Fixes:

- `niteroi.br / *.nom.br` - Change trie from `niteroinom>*` to `niteroi,nom>*`
- `police.uk / *.sch.uk` - Change trie from `policesch>*` to `police,sch>*`
- `budejju.no / nes.buskerud.no` - Change trie from `budejjubuskerud>nes` to `budejju,buskerud>nes`
- `hønefoss.no / os.hordaland.no` - Change trie from `hønefosshordaland>os` to `hønefoss,hordaland>os`
- `molde.no / heroy.more-og-romsdal.no` - Change trie from `moldemore-og-romsdal>heroy` to `molde,more-og-romsdal>heroy`
- `nordkapp.no / bo.nordland.no` - Change trie from `nordkappnordland>bo` to `nordkapp,nordland>bo`
- `osterøy.no / valer.ostfold.no` - Change trie from `osterøyostfold>valer` to `osterøy,ostfold>valer`
- `tananger.no / bo.telemark.no` - Change trie from `tanangertelemark>bo` to `tananger,telemark>bo`
- `vestby.no / sande.vestfold.no` - Change trie from `vestbyvestfold>sande` to `vestby,vestfold>sande`
- `haugesund.no / os.hedmark.no` - Change trie from `haugesundhedmark>os` to `haugesund,hedmark>os`
@jpstevens
Copy link
Contributor Author

Fixes #64

@jhnns jhnns added this to Current sprint in Open Source projects Feb 25, 2019
@jhnns jhnns self-requested a review February 25, 2019 18:18
@glasser
Copy link

glasser commented Feb 28, 2019

It's a lot more than just the ones that are listed there. Notably this fixes s3.amazonaws.com too.

@jhnns
Copy link
Member

jhnns commented Mar 4, 2019

Thanks for your PR and feedback. I'll review it the next days.

@jpstevens
Copy link
Contributor Author

Hey @jhnns - can you please merge and release these changes?

@flotwig
Copy link

flotwig commented May 17, 2019

@jhnns bump, this would be great to see fixed

if (indexOfDifference === -1) {
// Identical lines
return "";
}
if (indexOfDifference === 0) {
// line and prevLine are completely different
separatorFromPrev = SEPARATORS.RESET;
} else if (prevLine.length === line.length && indexOfDifference === line.length - 1) {
} else if (prevLine.length <= line.length && indexOfDifference === prevLine.length - 1) {
Copy link
Member

@jhnns jhnns May 27, 2019

Choose a reason for hiding this comment

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

I think the whole length check is not necessary or too strict. We should just compare indexOfDifference === prevLine.length - 1)

@jhnns jhnns changed the title Fix separator logic in trie serializer fix: Fix error where a lot of domains were not detected May 27, 2019
@jhnns jhnns merged commit fc80789 into peerigon:master May 27, 2019
Open Source projects automation moved this from Current sprint to Done May 27, 2019
@jhnns
Copy link
Member

jhnns commented May 27, 2019

Awesome 🎉 🎉 🎉 thank you so much for this PR. This fixes a lot of domains.

jhnns added a commit that referenced this pull request May 27, 2019
@jhnns
Copy link
Member

jhnns commented May 27, 2019

Published with v2.1.8 🚀

jhnns added a commit that referenced this pull request May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants