When finding the suffix of an input domain, it was not remembering if it had ever encountered a valid suffix along the way, so when a shorter suffix matches, but then it partially matches another rule, it would erroneously find no suffix. For example, cdn.fbsbx.com should find the suffix of com, but because it partially matches the rule for apps.fbsbx.com, it finds no suffix or root domain.
This changes the suffix finding algorithm to remember the longest valid suffix it has seen and uses that.
When finding the suffix of an input domain, it was not remembering if it had ever encountered a valid suffix along the way, so when a shorter suffix matches, but then it partially matches another rule, it would erroneously find no suffix. For example,
cdn.fbsbx.com
should find the suffix ofcom
, but because it partially matches the rule forapps.fbsbx.com
, it finds no suffix or root domain.This changes the suffix finding algorithm to remember the longest valid suffix it has seen and uses that.
Fixes #24