Skip to content

Commit

Permalink
fix: Remove AWS IMDS endpoint request on API startup (#5008)
Browse files Browse the repository at this point in the history
  • Loading branch information
rolodato authored Jan 16, 2025
1 parent c04eb95 commit 2e79ff4
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions api/app/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import dj_database_url
import pytz
import requests
from corsheaders.defaults import default_headers
from django.core.exceptions import ImproperlyConfigured
from django.core.management.utils import get_random_secret_key
Expand Down Expand Up @@ -67,15 +66,6 @@

INTERNAL_IPS = ["127.0.0.1"]

# In order to run a load balanced solution, we need to whitelist the internal ip
try:
internal_ip = requests.get("http://instance-data/latest/meta-data/local-ipv4").text
except requests.exceptions.ConnectionError:
pass
else:
ALLOWED_HOSTS.append(internal_ip)
del requests

if sys.version[0] == "2":
reload(sys)
sys.setdefaultencoding("utf-8")
Expand Down

0 comments on commit 2e79ff4

Please sign in to comment.