MCPcopy Index your code
hub / github.com/aws/aws-cli / _get_request_target

Method _get_request_target

awscli/botocore/httpsession.py:423–441  ·  view source on GitHub ↗
(self, url, proxy_url)

Source from the content-addressed store, hash-verified

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'')

Callers 1

sendMethod · 0.95

Calls 2

_path_urlMethod · 0.95
_proxies_kwargsMethod · 0.95

Tested by

no test coverage detected