diff --git a/src/main.rs b/src/main.rs index 65fa91b..6d53dbc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -135,7 +135,7 @@ async fn post_item( Path(id): Path, Query(params): Query, State(app_state): State, - TypedHeader(content_type): TypedHeader, + content_type: Option>, mut stream: BodyStream, ) -> HandlerResult { let id = sanitize_id(id); @@ -171,7 +171,7 @@ async fn post_item( data_file.write_all(&buf).await.unwrap(); } - metadata.mimetype = Some(content_type.to_string()); + metadata.mimetype = content_type.map(|x| x.0.to_string()); metadata.ttl = Some(expires_at); metadata.to_file(&app_state.path, &id).await.unwrap();