Skip to content

Commit

Permalink
utils: ensure Downloader defaults to Authenticator
Browse files Browse the repository at this point in the history
  • Loading branch information
abn committed Mar 22, 2024
1 parent a562bd1 commit bfe7be6
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/poetry/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
from typing import Any
from typing import overload

import requests

from requests.utils import atomic_open

from poetry.utils.authenticator import Authenticator
from poetry.utils.constants import REQUESTS_TIMEOUT


Expand All @@ -35,8 +34,6 @@
from poetry.core.packages.package import Package
from requests import Session

from poetry.utils.authenticator import Authenticator

logger = logging.getLogger(__name__)
prioritised_hash_types: tuple[str, ...] = tuple(
t
Expand Down Expand Up @@ -171,10 +168,10 @@ def __init__(
):
self._dest = dest

get = requests.get if not session else session.get
session = session or Authenticator()
headers = {"Accept-Encoding": "Identity"}

self._response = get(
self._response = session.get(
url, stream=True, headers=headers, timeout=REQUESTS_TIMEOUT
)
self._response.raise_for_status()
Expand Down

0 comments on commit bfe7be6

Please sign in to comment.