diff options
author | Sven-Hendrik Haase <svenstaro@gmail.com> | 2021-04-18 06:45:04 +0000 |
---|---|---|
committer | Sven-Hendrik Haase <svenstaro@gmail.com> | 2021-04-18 06:45:04 +0000 |
commit | 76284bea0eb1e8829eff934ac391d40d0d172ed6 (patch) | |
tree | e9a00c81ed84b6f0112c40bc94cdbb8b6f377cd3 | |
parent | Patch mime_guess to stop Firefox from becoming confused (fixes #160) (diff) | |
download | miniserve-76284bea0eb1e8829eff934ac391d40d0d172ed6.tar.gz miniserve-76284bea0eb1e8829eff934ac391d40d0d172ed6.zip |
Prefer UTF8 for text reponses (fixes #263)
This should fix most encoding problems in most cases where text files are accessed
on various locales.
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | src/main.rs | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 9713c49..723c37b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - 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) +- Prefer UTF8 for text responses [#263](https://github.com/svenstaro/miniserve/issues/263) ## [0.13.0] - 2021-03-28 - Change default log level to `Warn` diff --git a/src/main.rs b/src/main.rs index f174d57..b6dd856 100644 --- a/src/main.rs +++ b/src/main.rs @@ -465,6 +465,7 @@ fn configure_app(app: &mut web::ServiceConfig, conf: &MiniserveConfig) { title.clone(), ) }) + .prefer_utf8(true) .default_handler(web::to(error_404)); Some(files) } |