From 1438254cda90fe8c442bbe38efd8bc2142590edd Mon Sep 17 00:00:00 2001 From: Liang Jiaqing Date: Tue, 3 Nov 2026 17:19:15 +0800 Subject: [PATCH] =?UTF-8?q?fix(p2p):=20=E5=B9=B6=E9=9B=86=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E5=85=88=20unquote=20=E5=86=8D=E6=8C=89=20@hub=20?= =?UTF-8?q?=E6=8B=86=E5=90=8D(webui=20=E7=BC=96=E7=A0=81=E6=88=90=20%40=20?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=20offline=20=E9=AA=A8=E6=9E=B6=E5=B1=8F);=20?= =?UTF-8?q?pclink.js=20baseOf/hasPid=20=E5=85=BC=E5=AE=B9=20@hub?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontends/p2p_ws_client.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontends/p2p_ws_client.py b/frontends/p2p_ws_client.py index 4c471dc8..ccd08735 100644 --- a/frontends/p2p_ws_client.py +++ b/frontends/p2p_ws_client.py @@ -19,7 +19,7 @@ from collections import deque from contextlib import suppress from dataclasses import dataclass from pathlib import Path -from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit +from urllib.parse import parse_qsl, quote, unquote, urlencode, urlsplit, urlunsplit import websockets try: @@ -1332,8 +1332,9 @@ class HubUnion: if parts.path == "/api/peers": return await self._peers(dict(parse_qsl(parts.query, keep_blank_values=True)).get("psig")) hub = None - if len(path) > 3 and path[1] == "api" and "@" in path[2]: - path[2], _, hub = path[2].rpartition("@") + if len(path) > 3 and path[1] == "api" and "@" in unquote(path[2]): # webui įš„ encodeURIComponent 把 @ įž–æˆ %40 + name, _, hub = unquote(path[2]).rpartition("@") + path[2] = quote(name, safe="") target = urlunsplit(("", "", "/".join(path), parts.query, "")) elif body: with suppress(ValueError, AttributeError):