(self, url, proxy_url)
| 421 | return manager |
| 422 | |
| 423 | def _get_request_target(self, url, proxy_url): |
| 424 | has_proxy = proxy_url is not None |
| 425 | |
| 426 | if not has_proxy: |
| 427 | return self._path_url(url) |
| 428 | |
| 429 | # HTTP proxies expect the request_target to be the absolute url to know |
| 430 | # which host to establish a connection to. urllib3 also supports |
| 431 | # forwarding for HTTPS through the 'use_forwarding_for_https' parameter. |
| 432 | proxy_scheme = urlparse(proxy_url).scheme |
| 433 | using_https_forwarding_proxy = ( |
| 434 | proxy_scheme == 'https' |
| 435 | and self._proxies_kwargs().get('use_forwarding_for_https', False) |
| 436 | ) |
| 437 | |
| 438 | if using_https_forwarding_proxy or url.startswith('http:'): |
| 439 | return url |
| 440 | else: |
| 441 | return self._path_url(url) |
| 442 | |
| 443 | def _chunked(self, headers): |
| 444 | transfer_encoding = headers.get('Transfer-Encoding', b'') |
no test coverage detected