(
self,
request: Request,
auth: Auth,
follow_redirects: bool,
history: list[Response],
)
| 928 | raise exc |
| 929 | |
| 930 | def _send_handling_auth( |
| 931 | self, |
| 932 | request: Request, |
| 933 | auth: Auth, |
| 934 | follow_redirects: bool, |
| 935 | history: list[Response], |
| 936 | ) -> Response: |
| 937 | auth_flow = auth.sync_auth_flow(request) |
| 938 | try: |
| 939 | request = next(auth_flow) |
| 940 | |
| 941 | while True: |
| 942 | response = self._send_handling_redirects( |
| 943 | request, |
| 944 | follow_redirects=follow_redirects, |
| 945 | history=history, |
| 946 | ) |
| 947 | try: |
| 948 | try: |
| 949 | next_request = auth_flow.send(response) |
| 950 | except StopIteration: |
| 951 | return response |
| 952 | |
| 953 | response.history = list(history) |
| 954 | response.read() |
| 955 | request = next_request |
| 956 | history.append(response) |
| 957 | |
| 958 | except BaseException as exc: |
| 959 | response.close() |
| 960 | raise exc |
| 961 | finally: |
| 962 | auth_flow.close() |
| 963 | |
| 964 | def _send_handling_redirects( |
| 965 | self, |
no test coverage detected