Skip to content

fix(domain): strip trailing dot before domain filtering#901

Open
Noethix55555 wants to merge 1 commit into
gocolly:masterfrom
Noethix55555:fix/domain-trailing-dot
Open

fix(domain): strip trailing dot before domain filtering#901
Noethix55555 wants to merge 1 commit into
gocolly:masterfrom
Noethix55555:fix/domain-trailing-dot

Conversation

@Noethix55555

Copy link
Copy Markdown

Fixes #900

A trailing-dot FQDN such as example.com. refers to the same host as example.com but was not string-equal to a configured domain. As a result it bypassed DisallowedDomains and was wrongly blocked by AllowedDomains.

This trims the trailing dot at the top of isDomainAllowed. Added a table-driven regression test asserting that DisallowedDomains("example.com") blocks both example.com and example.com., and that AllowedDomains("example.com") allows example.com.. It fails on master and passes with the fix.

A trailing-dot FQDN such as "example.com." refers to the same host as
"example.com" but was not string-equal to a configured domain. This
let it bypass DisallowedDomains and be wrongly blocked by
AllowedDomains. Trim the trailing dot in isDomainAllowed.
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.

Trailing-dot FQDN bypasses domain filters

1 participant