- From: <bugzilla@wiggum.w3.org>
- Date: Thu, 26 Jun 2008 14:28:56 +0000
- To: public-qt-comments@w3.org
http://www.w3.org/Bugs/Public/show_bug.cgi?id=5705
Tim Mills <tim@cbcl.co.uk> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tim@cbcl.co.uk
--- Comment #4 from Tim Mills <tim@cbcl.co.uk> 2008-06-26 14:28:56 ---
Sorry, I think foo:// is valid.
Quoting the specification:
hier-part = "//" authority path-abempty
/ path-absolute
/ path-rootless
/ path-empty
The scheme and path components are required, though the path may be
empty (no characters). When authority is present, the path must
either be empty or begin with a slash ("/") character. When
authority is not present, the path cannot begin with two slash
characters ("//"). These restrictions result in five different ABNF
rules for a path (Section 3.3), only one of which will match any
given URI reference.
The following are two example URIs and their component parts:
foo://example.com:8042/over/there?name=ferret#nose
\_/ \______________/\_________/ \_________/ \__/
| | | | |
scheme authority path query fragment
| _____________________|__
/ \ / \
urn:example:animal:ferret:nose
So this is saying that:
path-absolute
path-rootless
path-empty
may not begin with '//'.
path-abempty can begin with '//' even if the authority is the empty string -
because the authority is still present. Note that the empty string is a valid
authority (matching the 'reg-name' production).
So foo:// is a valid URI with an empty authority and empty path. The '//' here
is _not_ part of the path.
Here's what Microsoft's .NET System.Uri class does with this...
$ New-object Uri('foo://')
AbsolutePath : /
AbsoluteUri : foo:///
Authority :
Host :
HostNameType : Basic
IsDefaultPort : True
IsFile : False
IsLoopback : True
IsUnc : False
LocalPath : /
PathAndQuery : /
Port : -1
Query :
Fragment :
Scheme : foo
OriginalString : foo://
DnsSafeHost :
IsAbsoluteUri : True
Segments : {/}
UserEscaped : False
UserInfo :
--
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Thursday, 26 June 2008 14:29:30 UTC