summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib.rs10
1 files changed, 6 insertions, 4 deletions
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?)
}