Open Bug 1750990 Opened 3 years ago Updated 3 years ago

Generic "text document" added as Content type for various extensions served without `Content-Type` header or with explicit `text/plain` content type

Categories

(Firefox :: File Handling, defect, P3)

Desktop
Unspecified
defect

Tracking

()

People

(Reporter: aflorinescu, Unassigned)

References

(Blocks 1 open bug)

Details

As part of testing for the Downloads panel improvements a thorough extension testing has been performed: complete list of extensions tested here: testrail_link

The following types were found to be added as a generic "text document" - windows, "text file" - mac which we believe it's not quite correct:

A. Windows 10 (testing complete)

.jsp (https://www.imperial.ac.uk/computing/csg/guides/java/jsp-tutorial---some-examples-of-java-servlet-pages/)
.tmp (http://file.fyicenter.com/188_TMP-File_Extension_for_Temporary_Files.html)
.email (href from localfile html )
.aspx (http://file.fyicenter.com/236_ASPX-File_Extension_for_ASP_NET_Script_Files.html)

B. MAC (testing complete)

.jsp (https://www.imperial.ac.uk/computing/csg/guides/java/jsp-tutorial---some-examples-of-java-servlet-pages/)
.tmp (http://file.fyicenter.com/188_TMP-File_Extension_for_Temporary_Files.html)
.email (href from localfile html )
.aspx (http://file.fyicenter.com/236_ASPX-File_Extension_for_ASP_NET_Script_Files.html)

C. Ubuntu (testing complete)

.jsp (https://www.imperial.ac.uk/computing/csg/guides/java/jsp-tutorial---some-examples-of-java-servlet-pages/)
.tmp (http://file.fyicenter.com/188_TMP-File_Extension_for_Temporary_Files.html)
.email (href from localfile html )
.aspx (http://file.fyicenter.com/236_ASPX-File_Extension_for_ASP_NET_Script_Files.html)

Note:

Kind'of hard to figure if this is a regression since it's v hard to get the content type added prior to browser.download.improvements_to_download_panel enabled.

Severity: -- → S4

Adrian, I think you said maybe you were going to close this? If not, can you please provide a direct link in the bug of how to reproduce, and more detail around what it means that they were added (when? as a result of doing what?) as a generic text document?

I'm wondering if you're hitting some of our fallback behaviour where we enforce a .txt extension if the website sends a text/plain mimetype, cf. bug 1679071, bug 1568003. I'm not sure if that's fixable. But it's hard to say without links to the examples you're using and clarification of when exactly you see this happening.

Flags: needinfo?(adrian.florinescu)

(In reply to :Gijs (he/him) from comment #1)

Adrian, I think you said maybe you were going to close this?

Bad day for science yesterday, I meant bug 1750748 to move towards invalid.
This issue is valid:

Steps:

.jsp:

  1. Open https://www.imperial.ac.uk/computing/csg/guides/java/jsp-tutorial---some-examples-of-java-servlet-pages/
  2. Scroll down to Using JDBC in JSP section, right click on Postgres.jsp or MSSQL.jsp and save link as.
  3. Unblock download, afterwhich use "Alawys Open similar files"

.tmp:

  1. Open http://file.fyicenter.com/188_TMP-File_Extension_for_Temporary_Files.html (tmp sample)
  2. Use "Alawys Open similar files" option from the Download panel
Flags: needinfo?(adrian.florinescu)

(In reply to :Gijs (he/him) from comment #1)

I'm wondering if you're hitting some of our fallback behaviour where we enforce a .txt extension if the website sends a text/plain mimetype, cf. bug 1679071, bug 1568003. I'm not sure if that's fixable. But it's hard to say without links to the examples you're using and clarification of when exactly you see this happening.

I believe it's a mix of the scenario in which the OS default is not set and seems to be reproducible preponderently with the save link as . I've hit recently the following example:

Steps:

  1. Right click and save link as, followed by "Always open with"
  • Windows machine 1: (VS2022 installed - ASP.NET server page file with VS2022 default)
    app. content type registered: ASP.NET Server Page

  • Windows machine 2: (default - no OS aspx file handler)
    app. content type registered: text document

Also, there is probably an additional mix with the mimetype we receive from the source as well and as Gijs points maybe different fallback mechanisms aswell, depending on source, filetype and OS defaults.

The main problem that I want to point for these cases here and also including the examples in bug 1750940 is that for the generic Application type added, be it text or Firefox HTML document will not apply the always open with default content type action to the extensions that are included in the generic type.

(In reply to Adrian Florinescu [:aflorinescu] from comment #3)

The main problem that I want to point for these cases here and also including the examples in bug 1750940 is that for the generic Application type added, be it text or Firefox HTML document will not apply the always open with default content type action to the extensions that are included in the generic type.

For the auto-open in case of save link as, I would assume that bug 1741431 fix pretty much answers it and if I'm reading https://bugzilla.mozilla.org/show_bug.cgi?id=1741431#c11 correctly, Save link as for any file type will default to always ask for the save as download. Gijs, can you please confirm if this is correct?

Flags: needinfo?(gijskruitbosch+bugs)

Like in bug 1750940, I think this would also have happened in the past if using the dialog to change filetype defaults (for files sent with Content-Disposition: attachment, at least).

Flags: needinfo?(gijskruitbosch+bugs)
Priority: -- → P3
Summary: Generic "text documet" added as Content type → Generic "text document" added as Content type for various extensions served without `Content-Type` header or with explicit `text/plain` content type
See Also: → 1750940
You need to log in before you can comment on or make changes to this bug.