Skip to content

Commit

Permalink
fix path construction in BaseUrl::BuildUrl()
Browse files Browse the repository at this point in the history
Fixes minio#173

Signed-off-by: Bala.FA <[email protected]>
  • Loading branch information
balamurugana committed Sep 17, 2024
1 parent 40824d0 commit 58898fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/request.cc
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ error::Error BaseUrl::BuildUrl(http::Url& url, http::Method method,
}

std::string host = url.host;
std::string path;
std::string path = "/";

if (enforce_path_style || !this->virtual_style) {
path = "/" + bucket_name;
Expand All @@ -282,7 +282,7 @@ error::Error BaseUrl::BuildUrl(http::Url& url, http::Method method,
}

if (!object_name.empty()) {
if (object_name.front() != '/') path += '/';
if (!utils::EndsWith(path, "/")) path += '/';
path += utils::EncodePath(object_name);
}

Expand Down

0 comments on commit 58898fb

Please sign in to comment.