From 0ee1203958d549da08b0aa0aa9444c8dfb84f5d8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 13 Apr 2024 11:40:17 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- proxy/http/proxy/plugin.py | 1 + proxy/http/proxy/server.py | 10 +++++----- proxy/plugin/proxy_pool.py | 1 - 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/proxy/http/proxy/plugin.py b/proxy/http/proxy/plugin.py index b44b1a872f..c1dfd34fa4 100644 --- a/proxy/http/proxy/plugin.py +++ b/proxy/http/proxy/plugin.py @@ -19,6 +19,7 @@ from ...common.utils import tls_interception_enabled from ...core.connection import TcpServerConnection + if TYPE_CHECKING: # pragma: no cover from ...common.types import HostPort from ...core.connection import UpstreamConnectionPool diff --git a/proxy/http/proxy/server.py b/proxy/http/proxy/server.py index 2361a2bf1d..fcaf3e7306 100644 --- a/proxy/http/proxy/server.py +++ b/proxy/http/proxy/server.py @@ -793,8 +793,8 @@ def _wrap_server( # we will cache such upstream hosts and avoid intercepting them for future # requests. logger.warning( - "ssl.SSLCertVerificationError: " - + "Server raised cert verification error for upstream: {0}".format( + 'ssl.SSLCertVerificationError: ' + + 'Server raised cert verification error for upstream: {0}'.format( upstream.addr[0], ), ) @@ -802,14 +802,14 @@ def _wrap_server( except ssl.SSLError as e: if e.reason == 'SSLV3_ALERT_HANDSHAKE_FAILURE': logger.warning( - "{0}: ".format(e.reason) - + "Server raised handshake alert failure for upstream: {0}".format( + '{0}: '.format(e.reason) + + 'Server raised handshake alert failure for upstream: {0}'.format( upstream.addr[0], ), ) else: logger.exception( - "SSLError when wrapping client for upstream: {0}".format( + 'SSLError when wrapping client for upstream: {0}'.format( upstream.addr[0], ), exc_info=e, diff --git a/proxy/plugin/proxy_pool.py b/proxy/plugin/proxy_pool.py index a70e3dc18f..eecac398a2 100644 --- a/proxy/plugin/proxy_pool.py +++ b/proxy/plugin/proxy_pool.py @@ -15,7 +15,6 @@ from typing import Any, Dict, List, Optional from proxy.core.connection import TcpServerConnection - from ..http import Url, httpHeaders, httpMethods from ..core.base import TcpUpstreamConnectionHandler from ..http.proxy import HttpProxyBasePlugin