From bde680c1883334955813b6e51a00d9fc2daabbbd Mon Sep 17 00:00:00 2001 From: lzh Date: Thu, 26 Mar 2026 16:04:32 +0800 Subject: [PATCH] =?UTF-8?q?fix(ops):=20VspNotifyClient=20=E5=BC=BA?= =?UTF-8?q?=E5=88=B6=20HTTP/1.1=EF=BC=8C=E4=BF=AE=E5=A4=8D=20h2c=20?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=E5=AF=BC=E8=87=B4=20body=20=E4=B8=A2?= =?UTF-8?q?=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit JDK 17 HttpClient 默认尝试 HTTP/2 升级(h2c),uvicorn 不支持 h2c 协商,处理 Upgrade 请求时丢弃 body,导致 Python 端收到空 {}。 强制 HTTP_1_1 禁用 h2c 升级。 Co-Authored-By: Claude Opus 4.6 (1M context) --- .../module/ops/infrastructure/vsp/config/VspNotifyConfig.java | 1 + 1 file changed, 1 insertion(+) diff --git a/viewsh-module-ops/viewsh-module-ops-biz/src/main/java/com/viewsh/module/ops/infrastructure/vsp/config/VspNotifyConfig.java b/viewsh-module-ops/viewsh-module-ops-biz/src/main/java/com/viewsh/module/ops/infrastructure/vsp/config/VspNotifyConfig.java index f617d12..1637758 100644 --- a/viewsh-module-ops/viewsh-module-ops-biz/src/main/java/com/viewsh/module/ops/infrastructure/vsp/config/VspNotifyConfig.java +++ b/viewsh-module-ops/viewsh-module-ops-biz/src/main/java/com/viewsh/module/ops/infrastructure/vsp/config/VspNotifyConfig.java @@ -16,6 +16,7 @@ public class VspNotifyConfig { @Bean(value = "vspRestTemplate", defaultCandidate = false) public RestTemplate vspRestTemplate(VspNotifyProperties properties) { HttpClient httpClient = HttpClient.newBuilder() + .version(HttpClient.Version.HTTP_1_1) .connectTimeout(Duration.ofMillis(properties.getConnectTimeout())) .build(); JdkClientHttpRequestFactory factory = new JdkClientHttpRequestFactory(httpClient);