Skip to content

Commit 4feb090

Browse files
authored
Merge branch 'main' into githubtags
2 parents f50b1ab + f9da836 commit 4feb090

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

README.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ environment variable with::
219219

220220
export GH_TOKEN=yourgithubtoken
221221

222+
If you are running behind a proxy, you will need to setup the standard ``https_proxy`` variable.
223+
224+
export https_proxy=https?://<proxy>:<port>
222225

223226
See `GitHub docs
224227
<https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token>`_

vulnerabilities/package_managers.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,10 @@ async def fetch(self, pkg, session):
8282
raise NotImplementedError
8383

8484

85-
def client_session():
86-
return ClientSession(raise_for_status=True, trust_env=True)
85+
def client_session(**kwargs):
86+
# trust_env is important so that https_proxy environment variable is used
87+
# in proxy protected environments
88+
return ClientSession(raise_for_status=True, trust_env=True, **kwargs)
8789

8890

8991
class LaunchpadVersionAPI(VersionAPI):
@@ -227,9 +229,7 @@ class DebianVersionAPI(VersionAPI):
227229
async def load_api(self, pkg_set):
228230
# Need to set the headers, because the Debian API upgrades
229231
# the connection to HTTP 2.0
230-
async with ClientSession(
231-
raise_for_status=True, headers={"Connection": "keep-alive"}
232-
) as session:
232+
async with client_session(headers={"Connection": "keep-alive"}) as session:
233233
await asyncio.gather(
234234
*[self.fetch(pkg, session) for pkg in pkg_set if pkg not in self.cache]
235235
)

0 commit comments

Comments
 (0)