Skip to content

Conversation

@nerdlem
Copy link

@nerdlem nerdlem commented Oct 26, 2025

This PR provides support for a simple .Iterate(f) mechanism allowing for restricted introspection into a loaded List. This drives a use case where the PSL is being used to proactively navigate the DNS namespace looking for non-obvious apexes.

- Add FlatType rule type (value 4) for @-prefixed domains
- Treat both domain and subdomains as independent registrable domains
- Example: @nhs.uk makes nhs.uk AND foo.nhs.uk both registrable
- Update NewRule() to parse @ prefix
- Update Decompose() with FlatType case logic
- Fix ineffective break statements (use continue instead)
- Update module name to github.com/nerdlem/publicsuffix-go
- Add comprehensive flat rules documentation to README
- All tests passing
- Change Decompose() for FlatType to return (full_domain, "")
- For @nhs.uk: nhs.uk -> ("nhs.uk", ""), foo.nhs.uk -> ("foo.nhs.uk", "")
- Add special handling in ParseFromListWithOptions for flat rules
- Flat rules now correctly return DomainName with TLD="" and SLD=full_domain
- This makes each domain independent without hierarchical suffix handling
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.

1 participant