Valid scheme http://

how is http:// a valid URI without a host?

Let us look at the derivation:

URI 
~> scheme ":" hierarchical [ "?" query ]
~> scheme ":" hierarchical [ "?" query ]
~> ALPHA *( ALPHA / DIGIT ) ":" hierarchical [ "?" query ]
~> 'h' *( ALPHA / DIGIT ) ":" hierarchical [ "?" query ]
~> 'h' (ALPHA / DIGIT) *( ALPHA / DIGIT ) ":" hierarchical [ "?" query ]
~> 'h' ALPHA *( ALPHA / DIGIT ) ":" hierarchical [ "?" query ]
~> 'h' 't' *( ALPHA / DIGIT ) ":" hierarchical [ "?" query ]
~> ...
~> "https" ":" hierarchical [ "?" query ]
~> "https" ":" "//" authority path [ "?" query ]
~> "https" ":" "//" [ userinfo "@" ] host path [ "?" query ]
~> "https" ":" "//" host path [ "?" query ]
~> "https" ":" "//" (IPv4address / reg-name) path [ "?" query ]
~> "https" ":" "//" reg-name path [ "?" query ]
~> "https" ":" "//" *pchar path [ "?" query ]
~> "https" ":" "//" path [ "?" query ]
~> "https" ":" "//" *( "/" *pchar ) [ "?" query ]
~> "https" ":" "//" [ "?" query ]
~> "https" ":" "//"
~> "https://"
5 Likes