If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Automatic content detection doesn't work for XML Files with Byte Order Mark (BOM)

UNCONFIRMED
Unassigned

Status

()

Firefox
File Handling
UNCONFIRMED
3 years ago
3 years ago

People

(Reporter: frog23, Unassigned)

Tracking

34 Branch
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

3 years ago
Prerequisites: 
 1. you have an XML-File (starting with <?xml version="1.0" encoding="utf-8"?>) encoded in UTF-8 with a byte order mark (BOM)
 2. that file has an extension other than *.xml
 3. the server delivers this file without a Content-Type header
 
Firefox does not recognize it as XML File and displays it as plain text ( see http://frog23.net/development/Firefox_Bug_XML_with_BOM.xyz ), whereas the same file without the byte order mark is displayed as XML (http://frog23.net/development/Firefox_Bug_XML_without_BOM.xyz ). 

Both files should be displayed as XML, since the file with BOM is a valid XML file and the content detection should also work for it. 

The two demo files, also serve as a reminder that bug 175946 is still not fixed.
(Reporter)

Comment 1

3 years ago
Created attachment 8535552 [details]
XML File with Byte Order Mark and xyz-Extension
(Reporter)

Comment 2

3 years ago
Created attachment 8535560 [details]
XML File without Byte Order Mark and xyz-Extension

When reproducing the bug on your own server, keep in mind that some servers are configured to always add a Content-Type when delivering a file and if the file extension is unknown then "text/plain" is delivered. So if this file is not displayed as XML when you have it on your own server, check the Content-Type header (either using the addon HTTP Resource Text [https://addons.mozilla.org/firefox/addon/http-resource-test/] or sites like http://hurl.it )
You need to log in before you can comment on or make changes to this bug.