1
0
Fork 0

Merge pull request 'fix archive url' (#34) from archive-url into main

Reviewed-on: https://codeberg.org/Cyborus/forgejo-api/pulls/34
This commit is contained in:
Cyborus 2024-01-02 00:21:32 +00:00
commit 2435d0fa40

View file

@ -215,7 +215,11 @@ impl Forgejo {
) -> Result<Option<bytes::Bytes>, ForgejoError> {
let request = self
.client
.get(format!("repos/{owner}/{repo}/archive/{target}.zip"))
.get(
self.url
.join(&format!("api/v1/repos/{owner}/{repo}/archive/{target}.zip"))
.unwrap(),
)
.build()?;
self.execute_opt_raw(request).await
}
@ -228,7 +232,13 @@ impl Forgejo {
) -> Result<Option<bytes::Bytes>, ForgejoError> {
let request = self
.client
.get(format!("repos/{owner}/{repo}/archive/{target}.tar.gz"))
.get(
self.url
.join(&format!(
"api/v1/repos/{owner}/{repo}/archive/{target}.tar.gz"
))
.unwrap(),
)
.build()?;
self.execute_opt_raw(request).await
}