fix release attachment download url
This commit is contained in:
		
							parent
							
								
									96b92daf23
								
							
						
					
					
						commit
						40b9454e8b
					
				
					 1 changed files with 6 additions and 4 deletions
				
			
		
							
								
								
									
										10
									
								
								src/lib.rs
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								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?)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue