On 9/06/2022 08:40, Дмитрий Архипов wrote:
The parsing-level distinction between the two is generically obvious and does not require recognition of the specific scheme; if the scheme colon is immediately followed by one or more slashes then it's an URL, otherwise it is not. But this is off-topic.
This is wrong, there's absolutely no syntactic distinction between URIs and URLs. The distinction is in their purpose. Consult this section:
Which I did clarify further down. I know this is the Internet, but you don't need to pick every little nit.
The two slashes mean that URI contains the authority part. One slash means it doesn't. What it means for the URI is essentially decided by the scheme or the application authors.
Containing any leading slashes means that the URI contains a path, which means that it represents a location, which automatically makes it an URL and not an URN. As I also said, while it is technically possible for a non-slash-leading URI to semantically represent a location and thus also be an URL, this is atypical and for most intents and purposes can and should be ignored as a useless distinction. Especially in the context of a generic parser.
How could they be URLs, when they aren't supposed to be used to Locate anything, and the defining characteristic of being a URL is that it describes how to get the thing?
Any URI that uses the http protocol is (by definition) an URL, because it is representing a location. It does not stop being a location just because there is no valid resource at the server claiming to be the authority for that location at any particular point in time (or if there is no such server); that just makes it an unreachable location.