summaryrefslogtreecommitdiffstats
path: root/src/repository.rs
diff options
context:
space:
mode:
authorCyborus <cyborus@cyborus.xyz>2023-12-11 20:31:52 +0100
committerCyborus <cyborus@cyborus.xyz>2023-12-11 21:52:45 +0100
commita2ff083f715f22a49ebbf3d40aca8373174f5448 (patch)
treec5fe2622a69c2b5ce108cf40026aa3cfcaa7405f /src/repository.rs
parenttest editing release (diff)
downloadforgejo-api-a2ff083f715f22a49ebbf3d40aca8373174f5448.tar.xz
forgejo-api-a2ff083f715f22a49ebbf3d40aca8373174f5448.zip
fix release attachments
Diffstat (limited to 'src/repository.rs')
-rw-r--r--src/repository.rs7
1 files changed, 4 insertions, 3 deletions
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<u8>,
) -> Result<Attachment, ForgejoError> {
- 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
}