After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 565176 - application/xml detected as text/html (which shouldn't be possible)
application/xml detected as text/html (which shouldn't be possible)
Status: RESOLVED NOTGNOME
Product: glib
Classification: Platform
Component: gio
2.16.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2008-12-20 15:07 UTC by Daniel Leidert
Modified: 2009-02-09 15:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Daniel Leidert 2008-12-20 15:07:41 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 "&lt;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.
Comment 1 Daniel Leidert 2008-12-20 15:17:59 UTC
Maybe a more prominent example: application/xhtml+xml vs. text/html.
Comment 2 Matthias Clasen 2008-12-20 15:31:02 UTC
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).
Comment 3 Daniel Leidert 2008-12-20 15:56:38 UTC
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.
Comment 4 Matthias Clasen 2008-12-20 16:11:41 UTC
> 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 ?