Closed Bug 1225255 Opened 9 years ago Closed 7 years ago

nsStandardURL should use nsNCRFallbackEncoderWrapper instead of raw nsIUnicodeEncoder

Categories

(Core :: Networking, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla53
Tracking Status
firefox53 --- fixed

People

(Reporter: hsivonen, Assigned: hsivonen)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-would-take])

Attachments

(1 file, 1 obsolete file)

The URL spec requires the "HTML" error handling mode when encoding the query string for parsing:
https://encoding.spec.whatwg.org/#encode

Therefore, nsStandardURL should use nsNCRFallbackEncoderWrapper instead of raw nsIUnicodeEncoder. (nsNCRFallbackEncoderWrapper can't fail for non-OOM reasons, so the UTF-8 fallback should be removed, too.)
Whiteboard: [necko-would-take]
Attached patch Gecko changes (obsolete) — Splinter Review
This is a minimal patch to the Gecko code to fix this. (Previously, I tried doing other cleanup around how the encoding info for the URL is kept around, but that caused the scope of the fix to grow too large very quickly. Let's not go there at this time and wait for rust-url to fix things like that.)

The bigger part of the fix here is going to be adjusting all the relevant test case expectations. I'll be away from Bugzilla for a couple of weeks. If someone else wants to pursue the test case adjustments before I get to it, please go ahead.
Attachment #8771382 - Attachment is obsolete: true
Assignee: nobody → hsivonen
Status: NEW → ASSIGNED
Attachment #8814564 - Flags: review?(mcmanus) → review?(valentin.gosu)
I really apologize for not rerouting this review earlier - I thought I had and just found it in a bz report assigned to me. I think I forgot to hit the publish review button on mozreview; probly cause I didn't actually review it.

again - apologies.
Comment on attachment 8814564 [details]
Bug 1225255 - Encode URL query string segments to bytes with HTML numeric character references for unmappable characters.

https://reviewboard.mozilla.org/r/95756/#review100696

Looks good. Thanks!
Attachment #8814564 - Flags: review?(valentin.gosu) → review+
Pushed by hsivonen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/501d5da362c3
Encode URL query string segments to bytes with HTML numeric character references for unmappable characters. r=valentin
https://hg.mozilla.org/mozilla-central/rev/501d5da362c3
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: