From 955c3ac0c4124f3807d0ac7be647668ea831cecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Nerma?= Date: Thu, 3 Mar 2022 01:29:59 +0100 Subject: [PATCH] Add support for audio files streaming (#2645) --- actix-files/CHANGES.md | 3 +++ actix-files/src/named.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/actix-files/CHANGES.md b/actix-files/CHANGES.md index 3f8e2a823..4d4c790e8 100644 --- a/actix-files/CHANGES.md +++ b/actix-files/CHANGES.md @@ -1,6 +1,9 @@ # Changes ## Unreleased - 2021-xx-xx +- Add support for streaming audio files by setting the `content-disposition` header `inline` instead of `attachement`. [#2645] + +[#2645]: https://github.com/actix/actix-web/pull/2645 ## 0.6.0 - 2022-02-25 diff --git a/actix-files/src/named.rs b/actix-files/src/named.rs index a307c6385..6f3c6e1c8 100644 --- a/actix-files/src/named.rs +++ b/actix-files/src/named.rs @@ -128,7 +128,7 @@ impl NamedFile { let ct = from_path(&path).first_or_octet_stream(); let disposition = match ct.type_() { - mime::IMAGE | mime::TEXT | mime::VIDEO => DispositionType::Inline, + mime::IMAGE | mime::TEXT | mime::AUDIO | mime::VIDEO => DispositionType::Inline, mime::APPLICATION => match ct.subtype() { mime::JAVASCRIPT | mime::JSON => DispositionType::Inline, name if name == "wasm" => DispositionType::Inline,