Skip to content

Commit

Permalink
fix: AmazonS3::remove wrong url spliced
Browse files Browse the repository at this point in the history
  • Loading branch information
KKould authored and ethe committed Dec 9, 2024
1 parent ea00d68 commit 216eb44
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fusio/src/impls/remotes/aws/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl AmazonS3Builder {
let trimmed_bucket = self.bucket.trim_start_matches('/');
let endpoint = if let Some(endpoint) = self.endpoint {
let trimmed_endpoint = endpoint.trim_end_matches('/');
format!("{}/{}", trimmed_endpoint, trimmed_bucket)
format!("{}/{}/", trimmed_endpoint, trimmed_bucket)
} else {
format!(
"https://{}.s3.{}.amazonaws.com",
Expand Down Expand Up @@ -221,7 +221,9 @@ impl Fs for AmazonS3 {
async fn remove(&self, path: &Path) -> Result<(), Error> {
let mut url = Url::from_str(self.as_ref().options.endpoint.as_str())
.map_err(|e| S3Error::from(HttpError::from(e)))?;
url.set_path(path.as_ref());
url = url
.join(path.as_ref())
.map_err(|e| S3Error::from(HttpError::from(e)))?;

let mut request = Request::builder()
.method(Method::DELETE)
Expand Down

0 comments on commit 216eb44

Please sign in to comment.