From a5c1915772b06e246bbb3c3cc837de02a71d669a Mon Sep 17 00:00:00 2001 From: Jan Stastny Date: Fri, 25 Jun 2021 13:26:12 +0200 Subject: [PATCH] Set CURLOPT_UNRESTRICTED_AUTH when authenticating (#1681) This is necessary for authentication to work with AWS when it responds with 307 to the check bucket request when mounting. This happens to newly created buckets according to https://aws.amazon.com/premiumsupport/knowledge-center/s3-http-307-response/. Prior to this, curl would follow the redirect, but would not include the `Authorization` header which would end up with `404`. Co-authored-by: Takeshi Nakatani --- src/curl.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/curl.cpp b/src/curl.cpp index a1c3491..ea17192 100644 --- a/src/curl.cpp +++ b/src/curl.cpp @@ -3400,6 +3400,7 @@ int S3fsCurl::CheckBucket() curl_easy_setopt(hCurl, CURLOPT_URL, url.c_str()); curl_easy_setopt(hCurl, CURLOPT_WRITEDATA, (void*)&bodydata); curl_easy_setopt(hCurl, CURLOPT_WRITEFUNCTION, WriteMemoryCallback); + curl_easy_setopt(hCurl, CURLOPT_UNRESTRICTED_AUTH, 1L); S3fsCurl::AddUserAgent(hCurl); // put User-Agent int result = RequestPerform();