Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: AmazonS3::remove wrong url spliced #112

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading