Browse Source

Bug fix: Logged responses to S3 PUT when creating directory right after querying the respective bucket region and endpoint were concatenated

(cherry picked from commit 3aabeef782c7359128d33dfd40531106293e7f25)

Source commit: da3ab21c82bdd46f34133a071831ae91de3ce34a
Martin Prikryl 4 years ago
parent
commit
8411c7eb83
1 changed files with 3 additions and 3 deletions
  1. 3 3
      source/core/S3FileSystem.cpp

+ 3 - 3
source/core/S3FileSystem.cpp

@@ -1183,15 +1183,15 @@ void __fastcall TS3FileSystem::CreateDirectory(const UnicodeString & ADirName, b
   }
   else
   {
-    TLibS3CallbackData Data;
-    RequestInit(Data);
-
     Key = GetFolderKey(Key);
 
     TLibS3BucketContext BucketContext = GetBucketContext(BucketName, Key);
 
     S3PutObjectHandler PutObjectHandler = { CreateResponseHandler(), NULL };
 
+    TLibS3CallbackData Data;
+    RequestInit(Data);
+
     S3_put_object(&BucketContext, StrToS3(Key), 0, NULL, FRequestContext, FTimeout, &PutObjectHandler, &Data);
 
     CheckLibS3Error(Data);