MCM Adds .zip Extension to the End of my .jar

Status

Demeng

Java Developer
Supreme
Feedback score
23
Posts
632
Reactions
526
Resources
3
So I decided to download my own resource, which is a jar, and noticed that it was named "[name].jar.zip" for some reason. Is this intended? Why? It just causes confusion to the buyer... the jar should not be extracted and they have to manually remove the .zip extension in order to use the jar. Just.. why?
 
Type
Bug report
Status
Implemented
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

MarkElf

9+ Year Member
Supreme
Feedback score
27
Posts
1,215
Reactions
1,217
Resources
2
A user informed me earlier today that he downloaded my resource, Kyra, he got a .zip with the plugin's source code. When downloading myself I get a .jar using chrome.
 
Last edited:

Demeng

Java Developer
Supreme
Feedback score
23
Posts
632
Reactions
526
Resources
3
Want to give it a try now?
KQThbZj.gif
 

Demeng

Java Developer
Supreme
Feedback score
23
Posts
632
Reactions
526
Resources
3
Also when downloading .zip files, in some cases you'll get a file with no file extension.
Had this happen when downloading all types of files on Firefox.
Never happened to me before :/
Works fine on Spigot, seems to be an MCM issue.
 

Justis

Community Member
Management
Feedback score
61
Posts
2,117
Reactions
2,414
Resources
0
Jars are merely zip archives. They both even start with the same file signature (504B0304). You could grab all of your class files, zip it with any zip tool, rename it to have a .jar extension, and it will function exactly the same as if you archived it via the JVM.

Consequently, it’s not uncommon for software tasked with guessing the mime type of a file to assume a java archive is a zip archive, especially if it doesn’t know of or ignores the file extension.
Our resource software seems to be detecting the mime type correctly for jars compressed by the JVM, but anything else gets detected as an application/zip. Our resource injector doesn’t compress jars using the JVM, so our mime type guessing software is reporting that it’s a zip.

https://bugzilla.mozilla.org/show_bug.cgi?id=1133166
FireFox has a "bug" where they’ll "correct" the extension depending on the mime type reported in the download header. Which is why FireFox users are getting some jars as zips.

Jayson is going to be patching this by reporting the mime type as an application/java-archive for any resource with a .jar extension. After all, not all jars are compressed using the JVM. It would be more appropriate to consider the file extension.

Will update this thread once the fix has been deployed.[DOUBLEPOST=1584736018][/DOUBLEPOST]Jayson has notified me that the mime type adjustment is now live. Demeng if you’d like to verify that you’re not having that issue anymore.
 
Last edited:

Demeng

Java Developer
Supreme
Feedback score
23
Posts
632
Reactions
526
Resources
3
Jayson has notified me that the mime type adjustment is now live. Demeng if you’d like to verify that you’re not having that issue anymore.
All good on my side, thanks!
 

Mick

BuiltByBit Owner
Management
Feedback score
28
Posts
6,413
Reactions
7,704
Resources
0
Jars are merely zip archives. They both even start with the same file signature (504B0304). You could grab all of your class files, zip it with any zip tool, rename it to have a .jar extension, and it will function exactly the same as if you archived it via the JVM.

Consequently, it’s not uncommon for software tasked with guessing the mime type of a file to assume a java archive is a zip archive, especially if it doesn’t know of or ignores the file extension.
Our resource software seems to be detecting the mime type correctly for jars compressed by the JVM, but anything else gets detected as an application/zip. Our resource injector doesn’t compress jars using the JVM, so our mime type guessing software is reporting that it’s a zip.

https://bugzilla.mozilla.org/show_bug.cgi?id=1133166
FireFox has a "bug" where they’ll "correct" the extension depending on the mime type reported in the download header. Which is why FireFox users are getting some jars as zips.

Jayson is going to be patching this by reporting the mime type as an application/java-archive for any resource with a .jar extension. After all, not all jars are compressed using the JVM. It would be more appropriate to consider the file extension.

Will update this thread once the fix has been deployed.[DOUBLEPOST=1584736018][/DOUBLEPOST]Jayson has notified me that the mime type adjustment is now live. Demeng if you’d like to verify that you’re not having that issue anymore.
Thanks for getting this sorted Justis. Since this has now been resolved I'll move this to the bug report archives, thanks for reporting it.
 
Status
Top