From 60d2ac3c7a03c6fd2940cf236d80abd375696ac2 Mon Sep 17 00:00:00 2001 From: Richard Caunt Date: Wed, 8 Nov 2017 15:09:59 +0000 Subject: [PATCH] Adding x-amz-security-token header --- src/curl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/curl.cpp b/src/curl.cpp index a88b7d0..077b5e4 100644 --- a/src/curl.cpp +++ b/src/curl.cpp @@ -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()); + } } }