Loading behave_utils/http.py +18 −2 Original line number Diff line number Diff line # Copyright 2021-2023 Dominik Sekotill <dom.sekotill@kodo.org.uk> # Copyright 2021-2024 Dominik Sekotill <dom.sekotill@kodo.org.uk> # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this Loading Loading @@ -60,8 +60,24 @@ class _DirectedAdapter(requests.adapters.HTTPAdapter): self.destination = address, port self.certificate = certificate def get_connection(self, url: str, proxies: Mapping[str, str]|None = None) -> connectionpool.HTTPConnectionPool: def get_connection_with_tls_context( self, request: requests.PreparedRequest, verify: bool|str|None, proxies: Mapping[str, str]|None = None, cert: tuple[str, str]|str|None = None, ) -> connectionpool.HTTPConnectionPool: assert request.url is not None return self.get_connection(request.url, proxies) def get_connection( self, url: str|bytes, proxies: Mapping[str, str]|None = None, ) -> connectionpool.HTTPConnectionPool: address, port = self.destination if isinstance(url, bytes): url = url.decode("ascii") parts = urlparse(url) if parts.hostname is None: raise LocationParseError(url) Loading Loading
behave_utils/http.py +18 −2 Original line number Diff line number Diff line # Copyright 2021-2023 Dominik Sekotill <dom.sekotill@kodo.org.uk> # Copyright 2021-2024 Dominik Sekotill <dom.sekotill@kodo.org.uk> # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this Loading Loading @@ -60,8 +60,24 @@ class _DirectedAdapter(requests.adapters.HTTPAdapter): self.destination = address, port self.certificate = certificate def get_connection(self, url: str, proxies: Mapping[str, str]|None = None) -> connectionpool.HTTPConnectionPool: def get_connection_with_tls_context( self, request: requests.PreparedRequest, verify: bool|str|None, proxies: Mapping[str, str]|None = None, cert: tuple[str, str]|str|None = None, ) -> connectionpool.HTTPConnectionPool: assert request.url is not None return self.get_connection(request.url, proxies) def get_connection( self, url: str|bytes, proxies: Mapping[str, str]|None = None, ) -> connectionpool.HTTPConnectionPool: address, port = self.destination if isinstance(url, bytes): url = url.decode("ascii") parts = urlparse(url) if parts.hostname is None: raise LocationParseError(url) Loading