(
self,
request: Request,
auth: Auth,
follow_redirects: bool,
history: list[Response],
)
| 1643 | raise exc |
| 1644 | |
| 1645 | async def _send_handling_auth( |
| 1646 | self, |
| 1647 | request: Request, |
| 1648 | auth: Auth, |
| 1649 | follow_redirects: bool, |
| 1650 | history: list[Response], |
| 1651 | ) -> Response: |
| 1652 | auth_flow = auth.async_auth_flow(request) |
| 1653 | try: |
| 1654 | request = await auth_flow.__anext__() |
| 1655 | |
| 1656 | while True: |
| 1657 | response = await self._send_handling_redirects( |
| 1658 | request, |
| 1659 | follow_redirects=follow_redirects, |
| 1660 | history=history, |
| 1661 | ) |
| 1662 | try: |
| 1663 | try: |
| 1664 | next_request = await auth_flow.asend(response) |
| 1665 | except StopAsyncIteration: |
| 1666 | return response |
| 1667 | |
| 1668 | response.history = list(history) |
| 1669 | await response.aread() |
| 1670 | request = next_request |
| 1671 | history.append(response) |
| 1672 | |
| 1673 | except BaseException as exc: |
| 1674 | await response.aclose() |
| 1675 | raise exc |
| 1676 | finally: |
| 1677 | await auth_flow.aclose() |
| 1678 | |
| 1679 | async def _send_handling_redirects( |
| 1680 | self, |
no test coverage detected