Skip to content
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
9 changes: 8 additions & 1 deletion src/azure_dfs_filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,15 @@ unique_ptr<AzureFileHandle> AzureDfsStorageFileSystem::CreateHandle(const OpenFi
auto storage_context = GetOrCreateStorageContext(opener, info.path, parsed_url);
auto file_system_client = storage_context->As<AzureDfsContextState>().GetDfsFileSystemClient(parsed_url.container);

// A trailing '/' is only a directory hint, not part of the resource name. Some DFS endpoints (e.g. OneLake)
// reject a GetProperties on a trailing-slash path with 403 AuthenticationFailed, so strip it for the client.
auto file_path = parsed_url.path;
if (file_path.size() > 1 && file_path.back() == '/') {
file_path.pop_back();
}

auto handle = make_uniq<AzureDfsStorageFileHandle>(*this, info, flags, storage_context->options,
file_system_client.GetFileClient(parsed_url.path));
file_system_client.GetFileClient(file_path));
if (!handle->PostConstruct()) {
return nullptr;
}
Expand Down
Loading