Skip to content

Commit

Permalink
this fix addresses the issue of only checking for GetObject during Il…
Browse files Browse the repository at this point in the history
…legalLocationConstraintException error during region-redirect
  • Loading branch information
ubaskota committed Nov 19, 2024
1 parent ed18b1e commit fcbdd24
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion botocore/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1778,7 +1778,7 @@ def redirect_from_error(self, request_dict, response, operation, **kwargs):
is_permanent_redirect = error_code == 'PermanentRedirect'
is_opt_in_region = (
error_code == 'IllegalLocationConstraintException'
and operation.name == 'GetObject'
and operation.name != 'CreateBucket'
)
if not any(
[
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1879,7 +1879,7 @@ def test_does_not_redirect_if_None_response(self):
)
self.assertIsNone(redirect_response)

def test_redirect_in_get_opt_in_region(self):
def test_redirects_on_illegal_location_constraint_from_opt_in_region(self):
request_dict = {
'url': 'https://il-central-1.amazonaws.com/foo',
'context': {
Expand Down Expand Up @@ -1907,7 +1907,7 @@ def test_redirect_in_get_opt_in_region(self):
)
self.assertEqual(redirect_response, 0)

def test_no_redirect_if_create_bucket_IllegalLocationConstraintException(
def test_no_redirect_on_illegal_location_constraint_from_bad_location_constraint(
self,
):
request_dict = {
Expand Down

0 comments on commit fcbdd24

Please sign in to comment.