diff --git a/pyproject.toml b/pyproject.toml index f3c9bbf..ae6e924 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,9 +84,9 @@ dependencies = [ # NOTE: 👇 # The versions of `black`, `ruff`, `codespell`, must be consistent with the `.pre-commit-config.yaml`. # Don't edit them manually, use `pre-commit run ver_sync` instead. - "black==24.3.0", - "ruff==0.3.4", - "codespell==2.2.6", + "black==24.4.2", + "ruff==0.5.0", + "codespell==2.3.0", # Don't write comments on these lines, because they will be removed by `pre-commit run ver_sync`. # NOTE: 👆 diff --git a/src/fastapi_proxy_lib/core/websocket.py b/src/fastapi_proxy_lib/core/websocket.py index 36dacd7..fb83575 100644 --- a/src/fastapi_proxy_lib/core/websocket.py +++ b/src/fastapi_proxy_lib/core/websocket.py @@ -490,10 +490,10 @@ async def send_request_to_target( # pyright: ignore [reportIncompatibleMethodOv # httpx.stream() # refer to: https://www.python-httpx.org/api/#helper-functions - client_request_headers: "HeaderTypes" = _change_client_header( + client_request_headers: HeaderTypes = _change_client_header( headers=websocket.headers, target_url=target_url ) - client_request_params: "QueryParamTypes" = websocket.query_params + client_request_params: QueryParamTypes = websocket.query_params # TODO: 是否可以不检查http版本? check_result = check_http_version(websocket.scope, SUPPORTED_WS_HTTP_VERSIONS) diff --git a/tests/test_ws.py b/tests/test_ws.py index 2119719..6c5b965 100644 --- a/tests/test_ws.py +++ b/tests/test_ws.py @@ -208,7 +208,7 @@ async def test_ws_proxy(self, tool_4_test_fixture: Tool4TestFixture) -> None: # NOTE: 这个测试不放在 `test_target_server_shutdown_abnormally` 来做 # 是因为这里已经有现成的target server,放在这里测试可以节省启动服务器时间 - aconnect_ws_subprocess_queue: "Queue[str]" = Queue() + aconnect_ws_subprocess_queue: Queue[str] = Queue() kwargs_async_client = {"proxies": NO_PROXIES} kwargs_aconnect_ws = {"url": proxy_server_base_url + "do_nothing"} @@ -256,7 +256,7 @@ async def test_target_server_shutdown_abnormally( 需要在 60s 内向客户端发送 1011 关闭代码. """ - subprocess_queue: "Queue[str]" = Queue() + subprocess_queue: Queue[str] = Queue() target_ws_server_subprocess = Process( target=_subprocess_run_echo_ws_uvicorn_server,