diff options
author | Cyborus <cyborus@cyborus.xyz> | 2024-04-18 00:51:59 +0200 |
---|---|---|
committer | Cyborus <cyborus@cyborus.xyz> | 2024-04-18 00:51:59 +0200 |
commit | 40b9454e8b22ac4608a0ea1219c8418dc3a94fe9 (patch) | |
tree | 724ee269e488c3143e445adc831c374dfb06e867 /src/lib.rs | |
parent | Merge pull request 'Auto-generate API' (#38) from autogen into main (diff) | |
download | forgejo-api-40b9454e8b22ac4608a0ea1219c8418dc3a94fe9.tar.xz forgejo-api-40b9454e8b22ac4608a0ea1219c8418dc3a94fe9.zip |
fix release attachment download url
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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?) } |