What is double slash semantics for schema in URI?

According to http://tools.ietf.org/html/rfc3986 and http://en.wikipedia.org/wiki/Uniform_resource_identifier , a URI may or may not contain a double slash after the schema identifier. This makes "urn: issn: 1535-3613" a valid URI just like "http://stackoverflow.com".

Is there a strict / formal need to include a double slash, or is it optional and in any case, what is the reason / semantics? When answering this question, provide a definitive answer. Do not tell me how you work with the browser / library / ...

+4
source share
3 answers

This is in the RFC that you linked: if there is // , it means that it follows the permissions. See Section 3 . Therefore, if a scheme uses permissions, it will use // after the colon (either requiring it if permissions are required in this scheme, or optionally if permissions are optional in this scheme). mailto does not use permissions in the sense of a URI, therefore mailto URIs do not include // .

+12
source

Besides the RFC, which fully explains the answer, I thought you might like this quote directly from the inventor of the World Wide Web .

When [Sir Tim Berners-Lee] asked what he would do differently, the answer was easy. "I would get rid of the slash after the colon. You really don't need it. It just seemed like a good idea at the time."

Source: http://www.wired.co.uk/news/archive/2014-02/06/tim-berners-lee-reclaim-the-web

+4
source

Well, if you want a "definitive answer", I think there is nothing more convincing than an official HTTP RFC document (see paragraph 3.2. 2, which refers to the HTTP URL scheme).

+1
source

Source: https://habr.com/ru/post/1391103/


All Articles