What is the semantics of the double slash following the scheme in a URI?

前端 未结 3 391
后悔当初
后悔当初 2021-01-02 16:03

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 following the schem

相关标签:
3条回答
  • 2021-01-02 16:27

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

    When [Sir Tim Berners-Lee] was asked what he would have done differently, the answer was easy. "I would have got rid of the slash slash after the colon. You don't really 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

    0 讨论(0)
  • 2021-01-02 16:28

    It's in the RFC you linked: If there is a //, it means that what follows that is the authority. See Section 3. So if the scheme uses an authority, it will use the // after the colon (either requiring it, if authority is required in that scheme, or having it be optional if authority is optional in that scheme). mailto doesn't use an authority in the URI sense, so mailto URIs don't include a //.

    0 讨论(0)
  • 2021-01-02 16:45

    Well, if you want a "conclusive answer", I think nothing is more conclusive than the official HTTP RFC document (see point 3.2.2 which talks about the HTTP URL scheme).

    0 讨论(0)
提交回复
热议问题