Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

nife87

Member Since 03 Aug 2007
Offline Last Active May 10 2013 05:11 AM
-----

Topics I've Started

Hiding multiple schemes within URI

13 February 2013 - 02:54 PM

I am currently writing a URI parser whilst reading the official documentation and noticed that it should be legal to conceal another/multiple schemes within the URI syntax. I would like to be able to specify multiple schemes within a valid URI, like so:

vfs:zip///home/user/test.zip

vfs:zip:file///home/user/test.zip#data/text.log

vfs:zip:file//user:encrypted-password@localhost:127/home/user/test.zip#data/text.log

 

According to the Generic Syntax (RFC 3986), specifically sections 3 - 3.3 (not all text is listed here):

URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]

hier-part = "//" authority path-abempty
/ path-absolute
/ path-rootless
/ path-empty
 

This means that any characters between the first ':' and the first '/' (specifying either authority or path) should be skipped by parsers and still validate the URI, enabling me to provide zero or more schemes (zip, file, http, etc.) after the primary scheme (vfs, in this case), as far as I can tell.

 

Any thoughts as to whether or not this is correctly understood?

 

Otherwise, I think I have to provide the additional schemes via the path part or as a query or fragment, although I would prefer to provide them up-front, like the above, in order to preserve the rest of URI from preliminary preprocessing (other than normalization and percent-decoding).


PARTNERS