-
Notifications
You must be signed in to change notification settings - Fork 71
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
Conversation
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`
Fixes #64 |
It's a lot more than just the ones that are listed there. Notably this fixes s3.amazonaws.com too. |
Thanks for your PR and feedback. I'll review it the next days. |
Hey @jhnns - can you please merge and release these changes? |
@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) { |
There was a problem hiding this comment.
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)
Awesome 🎉 🎉 🎉 thank you so much for this PR. This fixes a lot of domains. |
Published with |
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>*
toniteroi,nom>*
police.uk / *.sch.uk
Changes trie snapshot from
policesch>*
topolice,sch>*
budejju.no / nes.buskerud.no
Changes trie snapshot from
budejjubuskerud>nes
tobudejju,buskerud>nes
hønefoss.no / os.hordaland.no
Changes trie snapshot from
hønefosshordaland>os
tohønefoss,hordaland>os
molde.no / heroy.more-og-romsdal.no
Changes trie snapshot from
moldemore-og-romsdal>heroy
tomolde,more-og-romsdal>heroy
nordkapp.no / bo.nordland.no
Changes trie snapshot from
nordkappnordland>bo
tonordkapp,nordland>bo
osterøy.no / valer.ostfold.no
Changes trie snapshot from
osterøyostfold>valer
toosterøy,ostfold>valer
tananger.no / bo.telemark.no
Changes trie snapshot from
tanangertelemark>bo
totananger,telemark>bo
vestby.no / sande.vestfold.no
Changes trie snapshot from
vestbyvestfold>sande
tovestby,vestfold>sande
haugesund.no / os.hedmark.no
Changes trie snapshot from
haugesundhedmark>os
tohaugesund,hedmark>os