Hacker News new | ask | show | jobs
by otterlicious 2154 days ago
In an alternative future where the double slashes didn't exist we would just use the colon.

    http:example.com/thing.jpg
    :example.com/thing.jpg
1 comments

What would :443/thing.jpg mean? Is that a port or hostname?
Also, don’t forget user/pass prompt in a URL.
There is no ambiguity.

http:username:password@example.com/thing.jpg http:username:password@example.com:8080@example.com/thing.jpg

But they might have picked a different delimiter for that in this alternative future. Or perhaps realized it was a bad idea earlier.

IPv6 addresses are a different story. We definitely would have chosen a different character to delimit IPv6 addresses in this future.

A port. RFC 1912 states "Labels may not be all numbers, but may have a leading digit (e.g., 3com.com)."
FWIW I had googled whether hostnames may be entirely digits before asking this, and this SO answer suggested yes. Perhaps that doesn’t apply to URLs? But to be clear I meant hostname not a FQDN, because obviously there is no ambiguity once a dot is present.

https://serverfault.com/questions/638260/is-it-valid-for-a-h...