From e5714f33243d71d084ca7f6acb4ddd668652e5d3 Mon Sep 17 00:00:00 2001 From: Liu Rui Date: Thu, 26 Dec 2024 09:47:54 +0800 Subject: [PATCH] =?UTF-8?q?fix-GatewayRuntimeProvider-whoami=E4=BB=8Egw-us?= =?UTF-8?q?er=E8=8E=B7=E5=8F=96=E7=94=A8=E6=88=B7=E4=B8=8D=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E4=B8=AD=E6=96=87=E5=AD=97=E7=AC=A6=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ximatai/muyun/runtime/gateway/GatewayRuntimeProvider.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/muyun-runtime-gateway/src/main/java/net/ximatai/muyun/runtime/gateway/GatewayRuntimeProvider.java b/muyun-runtime-gateway/src/main/java/net/ximatai/muyun/runtime/gateway/GatewayRuntimeProvider.java index f2494d0..ddeb2de 100644 --- a/muyun-runtime-gateway/src/main/java/net/ximatai/muyun/runtime/gateway/GatewayRuntimeProvider.java +++ b/muyun-runtime-gateway/src/main/java/net/ximatai/muyun/runtime/gateway/GatewayRuntimeProvider.java @@ -8,6 +8,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Base64; import java.util.Optional; @ApplicationScoped @@ -20,7 +21,7 @@ public Optional getUser(RoutingContext context) { .flatMap(gwUser -> { try { // 尝试构建用户对象 - return Optional.of(IRuntimeUser.build(new JsonObject(gwUser))); + return Optional.of(IRuntimeUser.build(new JsonObject(new String(Base64.getDecoder().decode(gwUser))))); } catch (Exception e) { // 记录解析失败的日志 LOGGER.warn("Failed to parse gw-user header: {}", gwUser, e);