Hacker News new | past | comments | ask | show | jobs | submit login

You cannot include this information in every URL. If you want to include information on how to handle a URL, the proper way is to use an appropriate scheme.



You've not made a specific point, so I'm not sure how to respond.

Why wouldn't file-extensions work? HTML uses .html and .htm.

Why wouldn't MIME types work? HTML uses text/html.


Here are some valid URLs:

https://seirdy.one/

https://seirdy.one/favicon.ico (hint: it's not a .ico file)

https://example.com/index.php

What can you infer only from the URL, before you click? File extensions show server side file formats, which reveal information about the backend's file representation; these do not necessarily correspond to the mimetype. .php, .asp, and trailing slashes are all examples of this; a trailing .html only means that the resource is (probably) a static file on the server, but neither gemini not the Web (nor even Gopher) are necessarily against dynamic content.

Furthermore, web servers can send a mimetype header along with an "x-content-type-options: nosniff" header to make compliant user agents disregard the file extension and use whatever mimetype the "mimetype: " header supplies. I personally use this to deliver a PNG favicon when a browser requests "https://seirdy.one/favicon.ico". The file extension tells you nothing if the scheme is HTTP(S).

If you see someone link both a gemini and an https url, you know what the difference is in advance and that can inform which one you click.

The point of a scheme is to supply a guarantee about what standards a URL will conform to without reading the response. This is necessary to inform the behavior of the request itself, and as I've just explained it can also convey information to the user before they choose to make said request.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: