From f4a3c07defbfb023fa8b814de8c7034deb154d09 Mon Sep 17 00:00:00 2001 From: orhun Date: Wed, 28 Jul 2021 00:21:34 +0300 Subject: [PATCH] fix(upload): prevent sending empty file name --- src/header.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/header.rs b/src/header.rs index 2f031c9..542fa7d 100644 --- a/src/header.rs +++ b/src/header.rs @@ -42,6 +42,7 @@ impl ContentDisposition { .find(|param| param.is_filename()) .map(|param| param.as_filename()) .flatten() + .filter(|file_name| !file_name.is_empty()) .ok_or_else(|| error::ErrorBadRequest("file data not present")) } }