3 ms·
Extensions in HTTP mean jack-all. Content-types/MIME types are what actually tell you how the file should be treated. Imgur is serving text/html in their ".gif
by cheald 12y ago
Extensions in HTTP mean jack-all. Content-types/MIME types are what actually tell you how the file should be treated.
Imgur is serving text/html in their ".gifv" files. If you tried to load a gifv in a <video> tag it would crash and burn on you because...it's serving you an HTML document with a text/html MIME type.
Imgur will happily serve you GIFs and JPEGs with incorrect extensions - for example, if you get this image with a .gif extension, it's going to serve you a JPEG, and it's going to be decoded by libjpeg. The extension doesn't provide any useful information to the client about what to do with the data.
$ wget http://i.imgur.com/hDYj7E7.gif
--2014-10-09 14:00:53-- http://i.imgur.com/hDYj7E7.gif
Resolving i.imgur.com (i.imgur.com)... 23.235.47.193
Connecting to i.imgur.com (i.imgur.com)|23.235.47.193|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 158352 (155K) [image/jpeg]
Saving to: ‘hDYj7E7.gif’
2014-10-09 14:00:53 (865 KB/s) - ‘hDYj7E7.gif’ saved [158352/158352]
$ identify hDYj7E7.gif
hDYj7E7.gif JPEG 577x1024 577x1024+0+0 8-bit DirectClass 158KB 0.000u 0:00.030
- jonny_eh 12y ago> Extensions mean jack-all …to browsers.
- cheald 12y agoYou're right. I edited my post to clarify with "in HTTP". Though I'll argue that it's not really relevant in this context of this particular subject, since ".gifv" only makes sense in a browser/HTTP context. Everywhere else it's just HTML.