Jar files from GitLab are being turned into .jar.zip files
Since earlier this week my Firefox browser has been turning .jar files from GitLab into .jar.zip files, which prevents them from being used properly until renamed. Attempting to download the same files on Edge or Chrome works correctly, and attempting to download any jar files from other websites (even GitHub) also works correctly. It seems that GitLab is the only website that is affected by this.
Examples of files being affected (they should be downloaded as normal .jar files): 1. https://gitlab.com/Trafalcraft/antiRedstoneClock/uploads/3b3c84814d76810f826c3803eaca1e66/antiRedstoneClock-1.4.1.jar 2. https://gitlab.com/Aristois/ui-installer/-/jobs/2505715157/artifacts/raw/packager/Aristois-Free.jar 3. https://gitlab.com/Aristois/Installer/-/jobs/2495195255/artifacts/raw/packager/free/Installer-2.0.3.jar
I'm using Firefox developer edition (102.0b3), and already tried using private mode, resetting Firefox, and reinstalling. Since I use GitLab as a main source to upload files, many users have also complained the same problem to me, in which all of the users were running Firefox. After they downloaded with a different browser, it worked for them as well.
Alle antwurden (7)
How does GitLab send these files if you check this in the Network Monitor (content-type and content-disposition headers) ?
Thanks for the reply. To update this post, I also made a report on bugzilla which was confirmed by others.
content-type is indeed labelled as "application/zip" content-disposition is simply "attachment; filename="(Jar name).jar"
Checking the content-type with edge returns "text/html".
Bewurke troch Dyiing op
For reference:
- 1772758 - GitLab jar files are being renamed to .jar.zip
See also:
- 1746052 - Unify ways to select and validate filenames when saving
(please do not comment in bug reports
https://bugzilla.mozilla.org/page.cgi?id=etiquette.html)
Bewurke troch cor-el op
Ah yes, that's my report, I forgot to link it above. I'll just wait and see what happens then. Thanks
Dropa said
No download problem. See screenshot of the download option.
Changing it to "ask first" had no effect. You can even see that it says "compressed zip folder" in the window and has the zip icon. Mine even has the Java logo, but after pressing OK it still becomes a zip.
I've attached a reference. Edit: I believe the reference may be too large, here is an alt link
Bewurke troch Dyiing op
Dropa said
See screenshot of the download option.
Mine looks the same as yours. You can even see in the window that it says the filetype is "Compressed (zipped) folder" instead of "Executable jar file". The issue is after pressing OK.
I am not aware of any built-in setting to override this. I do have an add-on that can help, if you would consider that.
Here's how you set up the content-type override for .jar files:
(1) Install the extension from the Mozilla Add-ons site
- AMO page: https://addons.mozilla.org/firefox/addon/content-type-fixer/
- My help page: https://www.jeffersonscher.com/ext/content-type-fixer.html
(2) Click the new Zzzz button on the toolbar to wake it up and start listening/fixing requests -- see the first screenshot below
(3) Trigger the download that is causing the problem; the add-on will log the request
(4) Open the log to add a new rule -- see the first screenshot below
(5) On the line with the .jar request, click the Add button and then paste in this type:
application/java-archive
and click the Save Content-Type button -- see the second screenshot below
(6) Try the download again and Firefox should save it as a .jar file with whatever icon is set up for those at the system level -- see the third screenshot below
Success?