GNOME Bugzilla – Bug 565176
application/xml detected as text/html (which shouldn't be possible)
Last modified: 2009-02-09 15:01:25 UTC
I discover a glitch: I have an XML file, starting with the XML declaration. But one of the first elements is <header>. Using gvfs-info, the MIME type is deteced as text/html. But the file starts with an XML declaration (<?xml ...?>), so this can only be application/xhtml+xml, but not text/html. It seems, that the search string "<head" (for offset 0:256) in the shared-mime-info database is responsible for this result. Now I wonder, who should be responsible for solving this issue. IIRC gnomevfs specified some generic MIME types. It was first checked, if the file belonged to such a type and then only sub-types of this generic MIME type were considered. Is this still the design? If yes, maybe application/xml should be such a generic type, or its pattern need to be fixed. A file starting with an XML declaration IMO cannot be a text/html subtype (am I wrong?). Or is this an issue, that must be fixed in the sharted-mime-info database. Then please simply close this and I will open a bug at the fd.o bug-tracker.
Maybe a more prominent example: application/xhtml+xml vs. text/html.
It is all a guessing game. We can certainly try to make better guesses, within the limits of the mime info spec. I'm sure Bastien would consider a shared-mime-info patch that adds better html detection patterns (preferably with testcases).
Thanks for *not* answering, what I've asked you. Did you even read, what I wrote? My question is, if you still go the way of generic MIME types (which made the sub-class-of declaration necessary some years ago)? If that's still the case, the bug is on your side, because application/xml is definitly not a sub-type of text/html. That's why I was explaining the situation. That's not a question of "better html detection patterns". But thanks for nothing.
> Or is this an issue, that must be fixed in the sharted-mime-info database. Then > please simply close this and I will open a bug at the fd.o bug-tracker. You asked for it, no ?