From 593f93d7d8776e62b66cbfeb1db3002b4905185b Mon Sep 17 00:00:00 2001 From: neri Date: Sat, 29 Jan 2022 12:50:44 +0100 Subject: [PATCH] don't send content-disposition header for index.html --- src/upload.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/upload.rs b/src/upload.rs index 20003f8..0ad272a 100644 --- a/src/upload.rs +++ b/src/upload.rs @@ -24,10 +24,11 @@ const ID_CHARS: &[char] = &[ ]; pub async fn index(config: web::Data) -> Result { - NamedFile::open(config.static_dir.join("index.html")).map_err(|file_err| { + let file = NamedFile::open(config.static_dir.join("index.html")).map_err(|file_err| { log::error!("index.html could not be read {:?}", file_err); error::ErrorInternalServerError("this file should be here but could not be found") - }) + })?; + Ok(file.disable_content_disposition()) } pub async fn upload(