Browse code

Fixes #1082 - Allow to use signature v4 only, even for a command with no target bucket specified

Florent Viard authored on 2020/03/26 09:57:13
Showing 1 changed files
... ...
@@ -156,11 +156,8 @@ class S3Request(object):
156 156
     def use_signature_v2(self):
157 157
         if self.s3.endpoint_requires_signature_v4:
158 158
             return False
159
-        # in case of bad DNS name due to bucket name v2 will be used
160
-        # this way we can still use capital letters in bucket names for the older regions
161 159
 
162
-        if self.resource['bucket'] is None \
163
-           or self.s3.config.signature_v2 or self.s3.fallback_to_signature_v2:
160
+        if self.s3.config.signature_v2 or self.s3.fallback_to_signature_v2:
164 161
             return True
165 162
 
166 163
         return False