Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions core/services/azfile/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ impl Builder for AzfileBuilder {
signer,
sign_ctx,
share_name: self.config.share_name.clone(),
sas_token: self.config.sas_token.clone(),
}),
})
}
Expand Down
6 changes: 5 additions & 1 deletion core/services/azfile/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ pub struct AzfileCore {
pub root: String,
pub endpoint: String,
pub share_name: String,
pub sas_token: Option<String>,
pub signer: Signer<Credential>,
pub sign_ctx: Context,
}
Expand Down Expand Up @@ -306,12 +307,15 @@ impl AzfileCore {
// the official document does not mention the URL style path
// find the solution from the community FAQ and implementation of the Java-SDK
// ref: https://learn.microsoft.com/en-us/answers/questions/799611/azure-file-service-rest-api(rename)?page=1
let source_url = format!(
let mut source_url = format!(
"{}/{}/{}",
self.endpoint,
self.share_name,
percent_encode_path(&p)
);
if let Some(sas_token) = &self.sas_token {
source_url = format!("{source_url}?{sas_token}");
}

req = req.header(X_MS_FILE_RENAME_SOURCE, &source_url);

Expand Down
Loading