From 65a1595be46303afae1053a8ea3e5ecbf9dfc8b1 Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Sun, 18 Apr 2021 08:29:34 +0200 Subject: Patch mime_guess to stop Firefox from becoming confused (fixes #160) This was a pretty weird one. Turns out that if Firefox attempts to a open a .gz file directly but the MIME type is set as application/x-gzip instead of the more correct application/gzip then the file will somehow corrupt. I suspect it's trying to double-decode the file. --- CHANGELOG.md | 1 + Cargo.lock | 3 +-- Cargo.toml | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 488a3c2..9713c49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Wrap breadcrumbs at any char [#496](https://github.com/svenstaro/miniserve/pull/496) (thanks @aliemjay) - Add separate flags for compressed and uncompressed tar archives [#492](https://github.com/svenstaro/miniserve/pull/492) (thanks @deantvv) - Bump deps +- Fix Firefox becoming confused when opening a `.gz` file directly [#160](https://github.com/svenstaro/miniserve/issues/160) ## [0.13.0] - 2021-03-28 - Change default log level to `Warn` diff --git a/Cargo.lock b/Cargo.lock index 9629fc3..3e2f80e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1491,8 +1491,7 @@ checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] name = "mime_guess" version = "2.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" +source = "git+https://github.com/svenstaro/mime_guess.git#ac76840e14bc6f2f7cbbb347052ec7e4de7e3043" dependencies = [ "mime", "unicase", diff --git a/Cargo.toml b/Cargo.toml index cc264ca..e1ff588 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,3 +62,8 @@ url = "2" [build-dependencies] grass = "0.10" + +# This needs to stay here at least until https://github.com/abonander/mime_guess/pull/66 is merged. +# Also see https://github.com/svenstaro/miniserve/issues/160 +[patch.crates-io] +mime_guess = { git = "https://github.com/svenstaro/mime_guess.git" } -- cgit v1.2.3