[haiku-bugs] Re: [Haiku] #12163: MIME sniffing can't reliably detect html vs xhtml (was: WebPositive error on img tag between <a></a> tags)

  • From: "pulkomandy" <trac@xxxxxxxxxxxx>
  • Date: Fri, 03 Jul 2015 13:30:06 -0000

#12163: MIME sniffing can't reliably detect html vs xhtml
----------------------------------------+----------------------------
Reporter: haiqu | Owner: pulkomandy
Type: enhancement | Status: reopened
Priority: normal | Milestone: Unscheduled
Component: Applications/WebPositive | Version: R1/Development
Resolution: | Keywords:
Blocked By: | Blocking:
Has a Patch: 0 | Platform: All
----------------------------------------+----------------------------
Changes (by pulkomandy):

* status: closed => reopened
* type: bug => enhancement
* resolution: invalid =>


Comment:

but there is an XML header and a doctype saying xhtml transitional. So,
this pretends to be an XML file. Only when you start to parse it and
encounter the meta tag, you should switch to html (and probably start
parsing from the start again?).

So, you can force the MIME type of the file to "text/html" using the
addattr command.

I'm switching the ticket to enhancement and changing the description. I'm
not sure what we can do to improve our sniffing system, it's based on
simple rules to be reasonably fast, and XHTML and HTML may simply be too
similar to hope reasonably telling them apart, especially in cases like
your example.

--
Ticket URL: <https://dev.haiku-os.org/ticket/12163#comment:5>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts:

  • » [haiku-bugs] Re: [Haiku] #12163: MIME sniffing can't reliably detect html vs xhtml (was: WebPositive error on img tag between <a></a> tags) - pulkomandy