Skip to content

Commit

Permalink
Populate Host header properly (#112)
Browse files Browse the repository at this point in the history
Fixes #110

Signed-off-by: Bala.FA <[email protected]>
  • Loading branch information
balamurugana authored Mar 6, 2024
1 parent ebb3c60 commit 4de2f19
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/baseclient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,8 @@ minio::s3::BaseClient::GetPresignedObjectUrl(GetPresignedObjectUrlArgs args) {
utils::Time date = utils::Time::Now();
if (args.request_time) date = args.request_time;

signer::PresignV4(args.method, url.host, url.path, region, query_params,
std::string host = url.HostHeaderValue();
signer::PresignV4(args.method, host, url.path, region, query_params,
creds.access_key, creds.secret_key, date,
args.expiry_seconds);
url.query_string = query_params.ToQueryString();
Expand Down
2 changes: 1 addition & 1 deletion src/request.cc
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ minio::s3::Request::Request(http::Method method, std::string region,

void minio::s3::Request::BuildHeaders(http::Url& url,
creds::Provider* provider) {
headers.Add("Host", url.host);
headers.Add("Host", url.HostHeaderValue());
headers.Add("User-Agent", user_agent);

bool md5sum_added = headers.Contains("Content-MD5");
Expand Down

0 comments on commit 4de2f19

Please sign in to comment.