Skip to content

Conversation

@rmisev
Copy link
Member

@rmisev rmisev commented Oct 18, 2025

As of April 1, 2025, the Public Suffix List algorithm was modified so that the trailing dot of a domain would be retained in the result. Quotes from this algorithm:

  • The public suffix is the set of labels from the domain which match the labels of the prevailing rule, using the matching algorithm above. A trailing dot shall be added if the domain included one. (See Note 3)

Note 3
Callers of the algorithm often cannot determine if the domain to be queried is an FQDN but may treat example.com and example.com. as distinct. To support this, the algorithm should retain that distinction. This means looking up example.com should yield com while looking up example.com. should yield com. as the public suffix.

Therefore, there is no need to add a trailing dot to the result if the input domain has one, as this dot is retained by the PSL algorithm.


Preview | Diff

@annevk
Copy link
Member

annevk commented Oct 19, 2025

Not terribly impressed that the specification is on a wiki now... publicsuffix/list#792 is where the change was discussed.

This PR looks good to me, but I'll wait a bit with merging.

<a href="https://github.com/publicsuffix/list/wiki/Format#formal-algorithm">Public Suffix List algorithm</a>
with <var>host</var> as domain. [[!PSL]]

<li><p>Assert: <var>publicSuffix</var> is an <a>ASCII string</a> that does not
Copy link
Member

@shannonbooth shannonbooth Oct 19, 2025

Choose a reason for hiding this comment

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

This removes the ASCII assert previously added by c28ff95 - which I think was valuable as an assert as this did clarify behavior for me. But maybe it makes sense to explicitly have a spec note for it that we're using A-label instead of (or in combination of?) an assert?

Copy link
Member Author

@rmisev rmisev Oct 19, 2025

Choose a reason for hiding this comment

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

I have returned previously added asserts.

Copy link
Member

Choose a reason for hiding this comment

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

Can we keep trailingDot and use it in this assert? Like "publicSuffix is an ASCII string that ends with trailingDot"?

I like the additional clarity that gives especially since the Public Suffix specification is rather informal. Hopefully at some point we define Public Suffix in a proper standards body, but until that day...

We should also link "Assert" now that we're changing this.

Copy link
Member Author

Choose a reason for hiding this comment

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

@annevk I made the changes you suggested.

@annevk annevk merged commit 5252665 into whatwg:main Oct 30, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants