As far as I can tell, RFC 1738, section 3.10, as well as the BNF in
section 5 explicitly say that file: URI must have two forward slashes
before the optional hostname, followed by another forward slash, and
then the path.
However:
$ perl -MURI::file -e 'print URI::file->new_abs("/foo"), "\n"'
file:/foo
I would have expected "file:///foo". These "one-slash" file: URIs cause
various interoperability problems here and there with applications or
other libraries that require strict RFC compliance. For example,
XML::LibXML::SAX seems to treat "file:/foo" as a literal relative path
from the current directory (ie. "$PWD/file:/foo"), whereas "file:///foo"
works with it as expected.
Would it be possible to have this fixed in URI?