fix(UME): 兼容首批无marker场景并补充回归测试

告警分页在响应头缺失 marker 时直接结束迭代,避免首批已全量却重复翻页;同时补充对应单测并保持 HTTPTransport 传输方式与现网一致。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-05-08 20:13:10 +08:00
parent 2c0b52d972
commit 00afaaae3d
3 changed files with 35 additions and 4 deletions

View file

@ -177,8 +177,9 @@ class UMEClient:
def _client(self) -> httpx.Client:
# Use explicit HTTPTransport to keep behavior consistent with onsite validation.
# In this mode, requests run over HTTP/1.1 and avoid HTTP/2 negotiation issues.
transport = httpx.HTTPTransport()
return httpx.Client(verify=self.verify_tls, timeout=self.timeout_s, transport=transport)
transport = httpx.HTTPTransport(verify=self.verify_tls, http2=False)
return httpx.Client(transport=transport, timeout=self.timeout_s)
def _extract_token_and_ttl(self, payload: dict[str, Any]) -> tuple[str, int | None]:
token = ""