Browse Source

Merge "s3api: Allow lower-cased region name for AWS .NET SDK compatibility"

changes/17/690717/24
Zuul 1 week ago
committed by Gerrit Code Review
parent
commit
d6399b32e7
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      swift/common/middleware/s3api/s3request.py

+ 12
- 0
swift/common/middleware/s3api/s3request.py View File

@@ -283,6 +283,12 @@ class SigV4Mixin(object):
if cred_param[key] != self.scope[key]:
kwargs = {}
if key == 'region':
# Allow lowercase region name
# for AWS .NET SDK compatibility
if not self.scope[key].islower() and \
cred_param[key] == self.scope[key].lower():
self.location = self.location.lower()
continue
kwargs = {'region': self.scope['region']}
raise AuthorizationQueryParametersError(
invalid_messages[key] % (cred_param[key], self.scope[key]),
@@ -325,6 +331,12 @@ class SigV4Mixin(object):
if cred_param[key] != self.scope[key]:
kwargs = {}
if key == 'region':
# Allow lowercase region name
# for AWS .NET SDK compatibility
if not self.scope[key].islower() and \
cred_param[key] == self.scope[key].lower():
self.location = self.location.lower()
continue
kwargs = {'region': self.scope['region']}
raise AuthorizationHeaderMalformed(
invalid_messages[key] % (cred_param[key], self.scope[key]),


Loading…
Cancel
Save