Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Official name for URL "scheme plus authority"

Tags:

Assume an absolute http or https URL. I'm looking for an "official" or generally accepted name for the part of the URL that comes before the path.

    http://foo:[email protected]:8042/over/there?name=ferret#nose
    \_____________________________/
                  |
              this part

RFC 3986 defines the URL syntax parts as follows:

    http://foo:[email protected]:8042/over/there?name=ferret#nose
    \__/   \______________________/\_________/ \_________/ \__/
      |               |                |            |        |
   scheme         authority           path        query   fragment

RFC 6454 defines the origin (as in "same origin") of an the URL as the triple (scheme, host, port):

    http://foo:[email protected]:8042/over/there?name=ferret#nose
    \__/           \______________/
      \________________/
              |
           origin

As such, neither term is appropriate. Is there a good term for the part I'm looking at, or am I stuck with "scheme (plus ://) plus authority"?

like image 974
Søren Løvborg Avatar asked Sep 18 '15 16:09

Søren Løvborg


2 Answers

The name in practice and per the current URL standard for the part of a URL that comes before the path is in fact just origin.

The :// part of a URL is just a syntactic (or lexical?) artifact that there’s never any real need to mention in discussions about actual behavior of anything that consumes or processes URLs (other than low-level parsers of course).

The username-password part is a non-conforming misfeature that’s now only useful to discuss as a historical error. The relevant part of the current URL standard has this to say about it;

There is no conforming way to express a username or password of a URL record within a URL string.

So again in practice for any normal discussions of URLs that align with how the current standards define URLs, it’s sufficient to speak about a URL simply in terms of its highest-level parts being just four parts: its origin, its path, its query (part), and its fragment (part).

Certainly that is at least what the current URL standard itself limits it to.

like image 152
sideshowbarker Avatar answered Oct 01 '22 11:10

sideshowbarker


It would have to just be "scheme plus authority". Bear in mind, that you can't have a valid URI that just has a scheme plus authority, so the combination doesn't come up much as a unit to discuss, and so didn't end up with a name.

Note also that userinfo has never been allowed in HTTP URIs; particular schemes can prohibit or restrict the values of particular portions. Some browsers had a design flaw where they would accept userinfo and base authentication headers on it, but most now will at least warn about this being done, if they allow it at all.

like image 25
Jon Hanna Avatar answered Oct 01 '22 12:10

Jon Hanna