Skip to content

Commit

Permalink
Merge pull request #205 from rkben/master
Browse files Browse the repository at this point in the history
http: make httpx follow redirects by default
  • Loading branch information
flacjacket authored Feb 8, 2022
2 parents 81ed35b + b653922 commit 6760a0d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/amcrest/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,10 @@ async def _async_command(
httpx_timeout = timeout

async with httpx.AsyncClient(
auth=self._async_token, verify=self._verify, timeout=httpx_timeout
follow_redirects=True,
auth=self._async_token,
verify=self._verify,
timeout=httpx_timeout
) as client:
for loop in range(1, 2 + retries):
_LOGGER.debug(
Expand Down Expand Up @@ -393,7 +396,10 @@ async def _async_stream_command(
httpx_timeout = timeout

async with httpx.AsyncClient(
auth=self._async_token, verify=self._verify, timeout=httpx_timeout
follow_redirects=True,
auth=self._async_token,
verify=self._verify,
timeout=httpx_timeout
) as client:
async with client.stream("GET", url) as resp:
try:
Expand Down

0 comments on commit 6760a0d

Please sign in to comment.