From 40b9454e8b22ac4608a0ea1219c8418dc3a94fe9 Mon Sep 17 00:00:00 2001 From: Cyborus Date: Wed, 17 Apr 2024 18:51:59 -0400 Subject: fix release attachment download url --- src/lib.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index 161aac1..3a53fcb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -144,10 +144,12 @@ impl Forgejo { let release = self .repo_get_release_attachment(owner, repo, release, attach) .await?; - let request = self - .client - .get(format!("/attachments/{}", release.uuid.unwrap())) - .build()?; + let mut url = self.url.clone(); + url.path_segments_mut() + .unwrap() + .pop_if_empty() + .extend(["attachments", &release.uuid.unwrap().to_string()]); + let request = self.client.get(url).build()?; Ok(self.execute(request).await?.bytes().await?) } -- cgit v1.2.3