diff --git a/benchmark/requirements.txt b/benchmark/requirements.txt index 1b0d1fe2f0..0aec4bae79 100644 --- a/benchmark/requirements.txt +++ b/benchmark/requirements.txt @@ -1,4 +1,4 @@ -aiohttp==3.8.2 +aiohttp==3.10.3 # Blacksheep depends upon essentials_openapi which is pinned to pyyaml==5.4.1 # and pyyaml>5.3.1 is broken for cython 3 # See https://github.com/yaml/pyyaml/issues/724#issuecomment-1638587228 diff --git a/proxy/http/client.py b/proxy/http/client.py index 60e420e68f..1cae1be92d 100644 --- a/proxy/http/client.py +++ b/proxy/http/client.py @@ -34,15 +34,15 @@ def client( conn_close: bool = True, scheme: bytes = HTTPS_PROTO, timeout: float = DEFAULT_TIMEOUT, - content_type: bytes = b"application/x-www-form-urlencoded", + content_type: bytes = b'application/x-www-form-urlencoded', ) -> Optional[HttpParser]: """Makes a request to remote registry endpoint""" request = build_http_request( method=method, url=path, headers={ - b"Host": host, - b"Content-Type": content_type, + b'Host': host, + b'Content-Type': content_type, }, body=body, conn_close=conn_close, @@ -50,7 +50,7 @@ def client( try: conn = new_socket_connection((host.decode(), port)) except ConnectionRefusedError as exc: - logger.exception("Connection refused", exc_info=exc) + logger.exception('Connection refused', exc_info=exc) return None sock: TcpOrTlsSocket = conn if scheme == HTTPS_PROTO: @@ -61,7 +61,7 @@ def client( ctx.load_verify_locations(cafile=certifi.where()) sock = ctx.wrap_socket(conn, server_hostname=host.decode()) except Exception as exc: - logger.exception("Unable to wrap", exc_info=exc) + logger.exception('Unable to wrap', exc_info=exc) conn.close() return None parser = HttpParser(httpParserTypes.RESPONSE_PARSER) diff --git a/tests/http/test_client.py b/tests/http/test_client.py index 2aa2f8dd24..52d708e39a 100644 --- a/tests/http/test_client.py +++ b/tests/http/test_client.py @@ -17,12 +17,12 @@ class TestClient(unittest.TestCase): def test_client(self) -> None: response = client( - host=b"google.com", + host=b'google.com', port=443, - scheme=b"https", - path=b"/", - method=b"GET", - content_type=b"text/html", + scheme=b'https', + path=b'/', + method=b'GET', + content_type=b'text/html', ) assert response is not None - self.assertEqual(response.code, b"301") + self.assertEqual(response.code, b'301')