Skip to content

Commit 1775743

Browse files
authored
bug fix: add missing proxies to installers (#12900)
1 parent d0383c5 commit 1775743

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

localstack-core/localstack/packages/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from ..constants import LOCALSTACK_VENV_FOLDER, MAVEN_REPO_URL
1414
from ..utils.archives import download_and_extract
1515
from ..utils.files import chmod_r, chown_r, mkdir, rm_rf
16-
from ..utils.http import download
16+
from ..utils.http import download, get_proxies
1717
from ..utils.run import is_root, run
1818
from ..utils.venv import VirtualEnvironment
1919
from .api import InstallTarget, PackageException, PackageInstaller
@@ -198,7 +198,7 @@ def _get_download_url(self) -> str:
198198
gh_token = os.environ.get("GITHUB_API_TOKEN")
199199
if gh_token:
200200
headers = {"authorization": f"Bearer {gh_token}"}
201-
response = requests.get(self.github_tag_url, headers=headers)
201+
response = requests.get(self.github_tag_url, headers=headers, proxies=get_proxies())
202202
if not response.ok:
203203
raise PackageException(
204204
f"Could not get list of releases from {self.github_tag_url}: {response.text}"

localstack-core/localstack/packages/java.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from localstack.packages import InstallTarget, Package
99
from localstack.packages.core import ArchiveDownloadAndExtractInstaller
1010
from localstack.utils.files import rm_rf
11+
from localstack.utils.http import get_proxies
1112
from localstack.utils.platform import Arch, get_arch, is_linux, is_mac_os
1213
from localstack.utils.run import run
1314

@@ -169,7 +170,9 @@ def _download_url_latest_release(self) -> str:
169170
f"os={self.os_name}&architecture={self.arch}&image_type=jdk"
170171
)
171172
# Override user-agent because Adoptium API denies service to `requests` library
172-
response = requests.get(endpoint, headers={"user-agent": USER_AGENT_STRING}).json()
173+
response = requests.get(
174+
endpoint, headers={"user-agent": USER_AGENT_STRING}, proxies=get_proxies()
175+
).json()
173176
return response[0]["binary"]["package"]["link"]
174177

175178
def _download_url_fallback(self) -> str:

0 commit comments

Comments
 (0)