2012-04-04 18:39:35 |
Robert Collins |
description |
For an Ubuntu package there is a current versions page which shows each version in each pocket, for example:
https://launchpad.net/ubuntu/+source/pulseaudio
In this page the version specific links, those to the right of the 'expander' arrow, are relative links to the version specific sub-page, in this example something like:
<a href="1:1.1-0ubuntu14">
<img src="/@@/package-source" />
1:1.1-0ubuntu14
</a>
Where this version has an epoch, as pulseaudio does, this is formatted with a raw colon. This is ambigiously either a relative URL or a url using the protocol '1'. (This is displayed correctly in firefox but not in chromium.)
Looking at the URI spec (http://www.ietf.org/rfc/rfc2396.txt) there seems to be nothing to prevent chromiums interpretation of the link being valid as for an unknown scheme we cannot rely on anything other than the colon:
The URI syntax is dependent upon the scheme. In general, absolute
URI are written as follows:
<scheme>:<scheme-specific-part>
It therefore seems appropriate we either confirm this as a relative URL with a "./" prefix, or probabally more correctly encode the ":" as a % escape (I think %3A). |
For an Ubuntu package there is a current versions page which shows each version in each pocket, for example:
https://launchpad.net/ubuntu/+source/pulseaudio
In this page the version specific links, those to the right of the 'expander' arrow, are relative links to the version specific sub-page, in this example something like:
<a href="1:1.1-0ubuntu14">
<img src="/@@/package-source" />
1:1.1-0ubuntu14
</a>
Where this version has an epoch, as pulseaudio does, this is formatted with a raw colon. This is ambigiously either a relative URL or a url using the protocol '1'. (This is displayed correctly in firefox but not in chromium.)
Looking at the URI spec (http://www.ietf.org/rfc/rfc2396.txt) there seems to be nothing to prevent chromiums interpretation of the link being valid as for an unknown scheme we cannot rely on anything other than the colon:
The URI syntax is dependent upon the scheme. In general, absolute
URI are written as follows:
<scheme>:<scheme-specific-part>
It therefore seems appropriate we either confirm this as a relative URL with a "./" prefix, or probabally more correctly encode the ":" as a % escape (I think %3A).
Analysis
========
We should escape the first segment correctly, or use the ./ hack Andy suggests. Whomever looks at the code to see how we are generating the links can decide what makes the most sense. |
|