From 87f380b5526029207bde400de3beb95aa20db4f6 Mon Sep 17 00:00:00 2001 From: cyqsimon <28627918+cyqsimon@users.noreply.github.com> Date: Tue, 5 Sep 2023 18:01:38 +0800 Subject: Fix incorrect usage of app data extractor - `Data` extractor can only be used when app data is wrapped with `Data` --- src/file_op.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/file_op.rs b/src/file_op.rs index 329ee8c..d9786c4 100644 --- a/src/file_op.rs +++ b/src/file_op.rs @@ -173,11 +173,11 @@ pub struct FileOpQueryParameters { /// invalid. /// This method returns future. pub async fn upload_file( - conf: web::Data, req: HttpRequest, query: web::Query, payload: web::Payload, ) -> Result { + let conf = req.app_data::().unwrap(); let upload_path = sanitize_path(&query.path, conf.show_hidden).ok_or_else(|| { ContextualError::InvalidPathError("Invalid value for 'path' parameter".to_string()) })?; -- cgit v1.2.3