Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Hiding multiple schemes within URI


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 nife87   Members   -  Reputation: 516

Like
0Likes
Like

Posted 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).


Edited by nife87, 13 February 2013 - 02:57 PM.


Sponsor:

#2 jonathanjansson   Members   -  Reputation: 271

Like
1Likes
Like

Posted 13 February 2013 - 05:02 PM

There are no skipped characters after ':'. The variations cover the following cases:

 

scheme://authority/absolute/path

scheme://authority

scheme:/absolute/path

scheme:rootless/path

scheme:

 

http://en.wikipedia.org/wiki/URI_schemes lists some examples how various applications implement their URI schemes. Some of them abuses the authority component as a first path segment which seems wrong. It is allowed to skip '//' and start the path immediately after ':'.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS