Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions botocore/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3075,6 +3075,7 @@ class ContainerMetadataFetcher:
'169.254.170.23',
'fd00:ec2::23',
'localhost',
'host.docker.internal',
]

def __init__(self, session=None, sleep=time.sleep):
Expand Down
5 changes: 5 additions & 0 deletions tests/unit/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2775,6 +2775,11 @@ def test_localhost_http_is_allowed(self):
def test_localhost_with_port_http_is_allowed(self):
self.assert_can_retrieve_metadata_from('http://localhost:8000/foo')

def test_docker_host_http_is_allowed(self):
self.assert_can_retrieve_metadata_from(
'http://host.docker.internal/foo'
)

def test_localhost_https_is_allowed(self):
self.assert_can_retrieve_metadata_from('https://localhost/foo')

Expand Down