Skip to content

Commit

Permalink
fix: add https to regional STS endpoint (#1035)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenyu committed Sep 9, 2019
1 parent 697732b commit bae66a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/sagemaker/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ def sts_regional_endpoint(region):
Returns:
str: AWS STS regional endpoint
"""
return "sts.{}.amazonaws.com".format(region)
return "https://sts.{}.amazonaws.com".format(region)


class DeferredError(object):
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import time

from boto3 import exceptions
import botocore
import pytest
from mock import call, patch, Mock, MagicMock

Expand Down Expand Up @@ -564,4 +565,5 @@ def walk():

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

0 comments on commit bae66a0

Please sign in to comment.