Normalize fullwidth punctuation to ASCII across codebase.
Add scripts/normalize_ambiguous_unicode.py; fix corrupted patch_instance_theme_templates.py. Preserves curly quotes in string literals; removes Git homoglyph warnings on .env.example. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"""将 127.0.0.1 服务地址转为浏览器可访问的外链(内网 IP 或域名)。"""
|
||||
"""将 127.0.0.1 服务地址转为浏览器可访问的外链(内网 IP 或域名)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
@@ -10,7 +10,7 @@ _LOCAL_HOSTS = frozenset({"127.0.0.1", "localhost", "::1"})
|
||||
|
||||
def public_origin() -> tuple[str, str] | None:
|
||||
"""
|
||||
从环境变量读取对外 Origin。
|
||||
从环境变量读取对外 Origin.
|
||||
HUB_PUBLIC_ORIGIN=http://192.168.1.10 或 HUB_PUBLIC_HOST=192.168.1.10
|
||||
"""
|
||||
raw = (os.getenv("HUB_PUBLIC_ORIGIN") or os.getenv("HUB_PUBLIC_HOST") or "").strip()
|
||||
@@ -30,8 +30,8 @@ def public_origin() -> tuple[str, str] | None:
|
||||
|
||||
def browser_url(internal_url: str | None) -> str:
|
||||
"""
|
||||
中控本机请求仍用 internal_url;返回给前端、复盘链接用本函数。
|
||||
若未配置 HUB_PUBLIC_* 或原 URL 已是非本机地址,则原样返回。
|
||||
中控本机请求仍用 internal_url;返回给前端,复盘链接用本函数.
|
||||
若未配置 HUB_PUBLIC_* 或原 URL 已是非本机地址,则原样返回.
|
||||
"""
|
||||
if not internal_url or not str(internal_url).strip():
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user