In my Chrome I am getting these warnings:
Resource interpreted as stylesheet but transferred with MIME type text/plain.
Resource interpreted as script but transferred with MIME type text/html.
pngResource interpreted as image but transferred with MIME type text/plain.
Why should I care? Or what is the probability that there is a browser that wouldn't treat the resource as the main browsers do?
A MIME type (now properly called "media type", but also sometimes "content type") is a string sent along with a file indicating the type of the file (describing the content format, for example, a sound file might be labeled audio/ogg , or an image file image/png ).
MIME types are defined by three attributes: language (lang), encoding (enc), and content-type (type). At least one of these attributes must be present for each type. The most commonly used attribute is type. The server frequently considers the type when deciding how to generate the response to the client.
The main MIME media type for PDF is application/pdf. This type is defined by RFC 8118 and is the responsibility of ISO TC 171 SC 2 WG 8. It was last updated in March 2017, prior to the original publication of PDF 2.0, so the PDF Association is proposing a minor refresh and update in the upcoming May 2022 ISO meetings.
Serving files with an incorrect mime type can open up security holes. Here's a high profile example.
MIME types let the browser know what each file is. Browsers associate other applications, helper applications/extensions to handle certain MIME types. So, setting the correct MIME types will let the browser handle the object/file the way it was meant to be done.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With