IDN with non-ASCII TLD is displayed in Punycode

RESOLVED FIXED

Status

()

RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: tom, Assigned: dwitte)

Tracking

unspecified
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; ja; rv:1.9b2) Gecko/2007121016 Firefox/3.0b2
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; ja; rv:1.9b2) Gecko/2007121016 Firefox/3.0b2

For any domain with a non-ASCII top-level domain name, the whole domain is displayed in Punycode. This includes those TLDs which are whitelisted.

Reproducible: Always

Steps to Reproduce:
1. Visit http://例え.テスト/ (copy/paste or by clicking a link such as http://idn.icann.org/#The_example.test_names)
Actual Results:  
The location bar now contains http://xn--r8jz45g.xn--zckzah/メインページ

Expected Results:  
The location bar should contain http://例え.テスト/メインページ

This occurs with every one of the 11 domains which is whitelisted in network.IDN.whitelist.* (which correspond to the 11 domains listed here: http://idn.icann.org/#The_example.test_names ).
(Assignee)

Comment 1

11 years ago
confirmed. this is because we don't convert (and never have converted) the TLD before looking it up in the whitelist prefs, which are all ASCII:
http://mxr.mozilla.org/mozilla/source/netwerk/dns/src/nsIDNService.cpp#336

should we fix this? i know next to zero about IDN specs.

it seems like we'd need a duplicate spec for every ASCII TLD in UTF8.
Component: General → Networking
OS: Linux → All
Product: Firefox → Core
QA Contact: general → networking
Hardware: PC → All
(Assignee)

Updated

11 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Comment 2

11 years ago
see bug 397803, which added some punycoded whitelist prefs as part of an ICANN test of IDN TLD's, which apparently is what this bug is about.

so it looks like there's no need to add punycode or UTF8 whitelist prefs yet, we just need to make nsIIDNService do punycode TLD lookups correctly.

-> me
Assignee: nobody → dwitte
Blocks: 237820
Seems like it'd be simple enough for nsIDNService::isInWhitelist() to simply convert non-ascii TLD to ACE.
No longer blocks: 237820
Blocks: 237820
(Assignee)

Comment 4

11 years ago
Created attachment 294472 [details] [diff] [review]
v1

pretty simple, includes unit test. passes tests and fixes bug.
Attachment #294472 - Flags: superreview?(dveditz)
Attachment #294472 - Flags: review?(dveditz)
(Assignee)

Comment 5

11 years ago
Comment on attachment 294472 [details] [diff] [review]
v1

kicking to biesi - tiny patch, easy to review - name your (canadian) drink of choice!
Attachment #294472 - Flags: superreview?(dveditz)
Attachment #294472 - Flags: superreview?(cbiesinger)
Attachment #294472 - Flags: review?(dveditz)
Attachment #294472 - Flags: review?(cbiesinger)
Attachment #294472 - Flags: superreview?(cbiesinger)
Attachment #294472 - Flags: superreview+
Attachment #294472 - Flags: review?(cbiesinger)
Attachment #294472 - Flags: review+
(Assignee)

Comment 6

11 years ago
Comment on attachment 294472 [details] [diff] [review]
v1

seeking approval - pretty low-risk patch here!
Attachment #294472 - Flags: approval1.9?
Comment on attachment 294472 [details] [diff] [review]
v1

a1.9+=damons
Attachment #294472 - Flags: approval1.9? → approval1.9+
(Assignee)

Comment 8

11 years ago
Checking in netwerk/dns/src/nsIDNService.cpp;
/cvsroot/mozilla/netwerk/dns/src/nsIDNService.cpp,v  <--  nsIDNService.cpp
new revision: 1.37; previous revision: 1.36
done
Checking in netwerk/test/unit/test_idnservice.js;
/cvsroot/mozilla/netwerk/test/unit/test_idnservice.js,v  <--  test_idnservice.js
new revision: 1.3; previous revision: 1.2
done
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
(Assignee)

Updated

11 years ago
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.