Mime type incorrectly set in http headers on Windows Firefox 3.6.12 when uploading

RESOLVED DUPLICATE of bug 373621

Status

()

defect
--
major
RESOLVED DUPLICATE of bug 373621
9 years ago
9 years ago

People

(Reporter: pstavs, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Reporter

Description

9 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.2.12) Gecko/20101027 Ubuntu/10.04 (lucid) Firefox/3.6.12
Build Identifier: Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.2.12) Gecko/20101027 Ubuntu/10.04 (lucid) Firefox/3.6.12

The mime type in the header returns as application/octet-stream (the default) instead of the actual mime type (example: application/pdf). This occurs only in Windows (tested on XP with SP3).  

Other browsers (example: IE) work fine, as does the Linux version of Firefox 3.6.12!



Reproducible: Always

Steps to Reproduce:
1.Create a web form to upload files
2.Read back the mime type header
3.Compare with other browsers and Linux version of Firefox

*Not sure what Firefox is doing under the hood, never tried tested it, but I made an assumption that mime type detection is NOT done using the file extension. How does firefox detect the file type and set this header?
Actual Results:  
mime type is incorrect, which renders all mime type detection code completely useless... file extension detection is the only alternative, but is obviously error prone and insecure.

Expected Results:  
A mime type that matches other browsers and the Linux build of the same browser (3.6.12)

This is possibly loosely related to:596968, but there is very little detail provided in that report to go on.
Reporter

Comment 1

9 years ago
PLEASE NOTE: The detected version info above is NOT relevant to this bug.
Do you have a saved entry for PDF with application/octet-stream ?
Too bad that you can't see the content-type in the stupid helper application UI.

PLease try a new profile http://support.mozilla.com/en-US/kb/Managing+profiles
Reporter

Comment 3

9 years ago
Matthias, sorry but I am new to Bugzilla, this is my first report, so I don't understand your comment?? what do you mean by saved entry, the file uploads and I capture and examine the POST using firebug, or are you talking about something else?

> PLease try a new profile http://support.mozilla.com/en-US/kb/Managing+profiles
What is this about?
>What is this about?
Read the link and follow the instructions to create a new, additional Firefox profile. Start Firefox with this profile and retest.

Firefox doesn't have a list of file extensions/content-types. It looks in the configured helper applications, the installed pöugins and after that (in windows) in the registry for a extension to content type mapping.
You seem to have either a wrong entry somewhere or no entry at all for .pdf
Reporter

Comment 5

9 years ago
> Firefox doesn't have a list of file extensions/content-types. It looks in the
> configured helper applications, the installed plug-ins and after that (in
> windows) in the registry for a extension to content type mapping.
Wow, that is poor... you are even better off reading the file extension of the file in that case.

Well that explains a lot, the message here is that the Contect-Type header is rendered unreliable by Firefox and developers are forced to ignore it since Firefox doesn't ever bother to check the actual data. I know for certain IE checks the data which IMHO is the only correct approach (since at least version 4 and possibly before). 

Resolving this issue since its a design flaw not a bug.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → INVALID
Which part of that is a design flaw ?
IE is doing the same except that it probably doesn't use an entry from helper applications.
Reporter

Comment 7

9 years ago
> IE is doing the same except that it probably doesn't use an entry from helper
> applications.
No, not really true... the design flaw is that you can't rely on clients configuration, my help desk has had 3 cases this week where uploads fail in firefox and succeed in IE, I have replicated their setup to reproduce this problem. 

IANA standardizes mime types, you should use reference the most common types, and compare the actual data with your own map
http://www.iana.org/assignments/media-types/
Resolution: INVALID → DUPLICATE
Duplicate of bug: 373621
You need to log in before you can comment on or make changes to this bug.