If an <object> tag has a type attribute set that doesn't correspond to the data's file extension, then the type attribute is ignored. Test case 1: Load a .htm file with <object data="file.htm" type="text/plain">. Expected: The page source is shown. Result: Sometimes the source is shown, sometimes the document is rendered. Test case 2: Rename a .jpg file to .htm and try to display it with <object data="image.htm" type="image/jpeg">. Expected: The image is shown. Result: The file data is shown as if it was a HTML document.
The type attribute is advisory. The server-provided MIME type, if any, overrides it.