Adding x-amz-security-token header

This commit is contained in:
Richard Caunt 2017-11-08 15:09:59 +00:00 committed by GitHub
parent 967ef4d56b
commit 60d2ac3c7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2297,6 +2297,12 @@ void S3fsCurl::insertV4Headers(const string &op, const string &path, const strin
string auth = "AWS4-HMAC-SHA256 Credential=" + AWSAccessKeyId + "/" + strdate + "/" + endpoint +
"/s3/aws4_request, SignedHeaders=" + get_sorted_header_keys(requestHeaders) + ", Signature=" + Signature;
requestHeaders = curl_slist_sort_insert(requestHeaders, "Authorization", auth.c_str());
if (S3fsCurl::is_ecs) {
S3FS_PRN_INFO3("Adding x-amz-security-token header");
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-security-token", S3fsCurl::AWSAccessToken.c_str());
}
}
}