3 ms·
In a perfect world, mimetypes would not exist. A PDF file does not become a plain text file just because some berk serves it with "text/plain" and it shouldn't
by jodrellblank 18y ago
In a perfect world, mimetypes would not exist.
A PDF file does not become a plain text file just because some berk serves it with "text/plain" and it shouldn't open directly in the browser showing me a stream of gibberish.
A PDF file also does not suddenly become a security risk worthy of blocking at a firewall because some berk served it as "application/x-initech-file" (true story, name changed).
Use the file extension, that's what it's there for. If it's a .gif, don't load and run it as a Java program!
- trezor 18y agoHow do you suggest browsers should handle php, asp, aspx, ace, pl and py files then? How would the browser know if the server-generated content is a RSS feed, a image or a HTML page? Are you seriously suggesting it's the browser which should support whatever scripting backend which is used on the server? Mime-types is there for a reason.
- jodrellblank 18y agohmm, that's a bit of a flaw in my plan.