Skip to content

fix: add download attribute to fix JAR files saving as ZIP in Chromium#6065

Open
chank-op wants to merge 1 commit intomodrinth:mainfrom
chank-op:main
Open

fix: add download attribute to fix JAR files saving as ZIP in Chromium#6065
chank-op wants to merge 1 commit intomodrinth:mainfrom
chank-op:main

Conversation

@chank-op
Copy link
Copy Markdown

  • JAR files were downloading with a .zip extension in Chromium-based browsers (Chrome, Edge, Arc, Brave, Opera, Vivaldi)
  • Root cause: JAR files are ZIP archives internally, so Chromium sniffs the Content-Type as application/zip and overrides the filename extension when no download attribute is present
  • Fix: add download="<filename>" to all file download <a> tags so the browser uses the original filename from the API

- JAR files were downloading with a `.zip` extension in Chromium-based browsers (Chrome, Edge, Arc, Brave, Opera, Vivaldi)
- Root cause: JAR files are ZIP archives internally, so Chromium sniffs the `Content-Type` as `application/zip` and overrides the filename extension when no `download` attribute is present
- Fix: add `download="<filename>"` to all file download `<a>` tags so the browser uses the original filename from the API
@modrinth-bot
Copy link
Copy Markdown
Member

Pull request changelog

App

Added

Changed

Deprecated

Removed

Fixed

Security

Website

Added

Changed

Deprecated

Removed

Fixed

Security

Hosting

Added

Changed

Deprecated

Removed

Fixed

Security

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants