问题描述
GET /status 在 host 模式下返回 connection_type=null,而非合法字符串。
复现步骤
- 启动 acp_relay.py(host 模式,无 peer 连接)
- GET /status
- 观察 connection_type 字段
预期行为
connection_type 应为 "host"(host 模式)或其他合法值之一
实际行为
connection_type 为 null
影响范围
test_nat_integration.py 断言失败;客户端依赖 connection_type 判断连接类型的逻辑会误判
根因
_status 字典初始化时 connection_type 未设默认值
修复方案
host 模式启动时将 connection_type 初始化为 'host';peer 断开时也重置为 'host'
问题描述
GET /status 在 host 模式下返回 connection_type=null,而非合法字符串。
复现步骤
预期行为
connection_type 应为 "host"(host 模式)或其他合法值之一
实际行为
connection_type 为 null
影响范围
test_nat_integration.py 断言失败;客户端依赖 connection_type 判断连接类型的逻辑会误判
根因
_status 字典初始化时 connection_type 未设默认值
修复方案
host 模式启动时将 connection_type 初始化为 'host';peer 断开时也重置为 'host'