Skip to content

Commit bae66a0

Browse files
authored
fix: add https to regional STS endpoint (#1035)
1 parent 697732b commit bae66a0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/sagemaker/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ def sts_regional_endpoint(region):
553553
Returns:
554554
str: AWS STS regional endpoint
555555
"""
556-
return "sts.{}.amazonaws.com".format(region)
556+
return "https://sts.{}.amazonaws.com".format(region)
557557

558558

559559
class DeferredError(object):

tests/unit/test_utils.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import time
2323

2424
from boto3 import exceptions
25+
import botocore
2526
import pytest
2627
from mock import call, patch, Mock, MagicMock
2728

@@ -564,4 +565,5 @@ def walk():
564565

565566
def test_sts_regional_endpoint():
566567
endpoint = sagemaker.utils.sts_regional_endpoint("us-west-2")
567-
assert endpoint == "sts.us-west-2.amazonaws.com"
568+
assert endpoint == "https://sts.us-west-2.amazonaws.com"
569+
assert botocore.utils.is_valid_endpoint_url(endpoint)

0 commit comments

Comments
 (0)