This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 20751 - IPv6 serializer may add extra colon
Summary: IPv6 serializer may add extra colon
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: URL (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: Unsorted
Assignee: Anne
QA Contact: sideshowbarker+urlspec
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-24 06:00 UTC by NARUSE, Yui
Modified: 2013-01-25 15:29 UTC (History)
1 user (show)

See Also:


Attachments

Description NARUSE, Yui 2013-01-24 06:00:36 UTC
Specification: http://url.spec.whatwg.org/#concept-ipv6-serializer

Current algorithm may add extra colons.

For example 1:2::7:8
pieces = [1, 2, 0, 0, 0, 0, 7, 8]

In this case, after output 2, it outputs : and then output :: with compress pointer like "1:2:::7:8".
To fix this, the algorithm should be changed like following:

4. Let skipflag be false.
5. For each piece in address's pieces, run these substeps:
5.1. If compress pointer points to piece, append "::" to output, let skipflag be true, and then skip subsequent substeps.
5.2. If skipflag is true, run these substeps:
5.2.1. If piece is 0, and then jump to Main.
5.2.2. let skipflag be false.
5.3. Otherwise, if piece is not the first of address's pieces, append ":" to output.
5.4. Append piece, represented as the shortest possible lowercase hexadecimal number, to output.
Comment 1 Anne 2013-01-25 15:29:41 UTC
Attempted a different fix: https://github.com/whatwg/url/commit/3f75853e7660b38bb04c0e5a7d835256b62fc2f6