5 ms·
What about file extensions?
by allendoerfer 1y ago
What about file extensions?
- jdiff 1y agoSometimes respected, largely ignored. URLs very often don't map directly to files served.
- allendoerfer 1y agoImages almost always do.
- jdiff 1y agoI wish, would make my job a good bit easier. Sometimes they don't even respect format query parameters and just use whatever's in your Accept headers. Will say though that it's not universal, it depends heavily on the corner of the internet you're on.
- georgyo 1y agoFile extensions are just a hint about what the file might be and have nothing to do with what the file actually is. If the server sets the MIME type, the browser will use that as the hint. But even beyond that, most file formats have a bit of a header at the start of the file that declares the actual format of the file. Browsers already can understand that and use the correct render for a file without an extension.
- allendoerfer 1y agoWhat if the user wants to use the file outside the browser, where they do not have access to the HTTP headers?
- georgyo 1y agoThe same is true, if you rename a .png to .jpg and opening it with an image viewer, it will render.