-
Notifications
You must be signed in to change notification settings - Fork 18k
x/net/publicsuffix: PublicSuffix() is case sensitive #25254
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
Comments
Test cases from the official PSL repo:
This indicates that PublicSuffix should be case insensitive. Note these test cases are missing from x/net/publicsuffix. I wonder if they were omitted intentionally. @vdobler @nigeltao |
Yes this is deliberate because the tests would not pass. EffectiveTLDPlusOne returns the eTLD+1 of its argument
|
I think the EffectiveTLDPlusOne should preserve the original capitalisation, but it should not give different results depending on how the input was capitalised for example: Current:
Expected:
These different results was how I originally found the issue. |
The unexpected result you see with mixed case inputs is addressed in
The current implementation of package publicsuffix requires arguments But of course this is unintuitive and not documented. You demonstrated un-intuitive behavior with uppercase domain names.
@nigeltao
What do you think? |
I understand the "works well" expectation, but I think that there's a bigger question of how does Go generally handle IDNs (and upper/mixed case domains)? I think any answer needs to be consistent across net, net/http, net/http/cookiejar, net/url, x/net/publicsuffix, etc, and not just a tactical modification only to x/net/publicsuffix. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
PublicSuffix() returns incorrect values when the domain contains letters with uppercase
According to RFC4343 I believe PublicSuffix() should be case insensitive.
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: