From a2ff083f715f22a49ebbf3d40aca8373174f5448 Mon Sep 17 00:00:00 2001 From: Cyborus Date: Mon, 11 Dec 2023 14:31:52 -0500 Subject: fix release attachments --- src/repository.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/repository.rs') diff --git a/src/repository.rs b/src/repository.rs index 4d89ec9..8b063a0 100644 --- a/src/repository.rs +++ b/src/repository.rs @@ -140,11 +140,12 @@ impl Forgejo { repo: &str, id: u64, name: &str, - file: &[u8], + file: Vec, ) -> Result { - self.post_form( + self.post_multipart( &format!("repos/{owner}/{repo}/releases/{id}/assets?name={name}"), - &file, + reqwest::multipart::Form::new() + .part("attachment", reqwest::multipart::Part::bytes(file).file_name("file").mime_str("*/*").unwrap()), ) .await } -- cgit v1.2.3