Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Zer0xFF committed May 18, 2022
1 parent 643b3b8 commit 4579db6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/amazon/AmazonS3Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CAmazonS3Client::CAmazonS3Client(CAmazonConfigs configs, std::string region)
{
}

CAmazonClient::Request CAmazonS3Client::CreateRequest(Framework::Http::HTTP_VERB method, std::string bucket, std::string key)
CAmazonClient::Request CAmazonS3Client::CreateRequest(Framework::Http::HTTP_VERB method, std::string bucket, std::string path)
{
Request rq;
rq.method = method;
Expand All @@ -21,9 +21,9 @@ CAmazonClient::Request CAmazonS3Client::CreateRequest(Framework::Http::HTTP_VERB
{
auto endpoint = "r2.cloudflarestorage.com";
rq.uri = string_format("/%s", bucket.c_str());
if(!key.empty())
if(!path.empty())
{
rq.uri = string_format("%s/%s", rq.uri.c_str(), key.c_str());
rq.uri = string_format("%s/%s", rq.uri.c_str(), path.c_str());
}
rq.host = string_format("%s.%s", m_configs.accountKeyId.c_str(), endpoint);
rq.urlHost = rq.host;
Expand All @@ -34,9 +34,9 @@ CAmazonClient::Request CAmazonS3Client::CreateRequest(Framework::Http::HTTP_VERB
assert(m_configs.m_provider == CAmazonConfigs::S3PROVIDER::AWS_S3);

rq.uri = "/";
if(!key.empty())
if(!path.empty())
{
rq.uri = string_format("/%s", key.c_str());
rq.uri = string_format("/%s", path.c_str());
}

std::string endpoint = "amazonaws.com";
Expand Down

0 comments on commit 4579db6

Please sign in to comment.