diff --git a/src/backend/websocket/biz-websocket/src/main/kotlin/com/tencent/bkrepo/websocket/handler/SessionHandler.kt b/src/backend/websocket/biz-websocket/src/main/kotlin/com/tencent/bkrepo/websocket/handler/SessionHandler.kt index 86e6ed35d5..e89fc9652c 100644 --- a/src/backend/websocket/biz-websocket/src/main/kotlin/com/tencent/bkrepo/websocket/handler/SessionHandler.kt +++ b/src/backend/websocket/biz-websocket/src/main/kotlin/com/tencent/bkrepo/websocket/handler/SessionHandler.kt @@ -39,6 +39,7 @@ import com.tencent.bkrepo.common.security.http.jwt.JwtAuthProperties import com.tencent.bkrepo.common.security.manager.AuthenticationManager import com.tencent.bkrepo.common.security.util.JwtUtils import com.tencent.bkrepo.websocket.constant.APP_ENDPOINT +import com.tencent.bkrepo.websocket.constant.DESKTOP_ENDPOINT import com.tencent.bkrepo.websocket.constant.SESSION_ID import com.tencent.bkrepo.websocket.constant.USER_ENDPOINT import com.tencent.bkrepo.websocket.service.WebsocketService @@ -104,7 +105,7 @@ class SessionHandler( val sessionId = HostUtils.getRealSession(uri?.query) when { uri == null -> throw AuthenticationException("uri is null") - uri.path.startsWith(USER_ENDPOINT) -> { + uri.path.startsWith(USER_ENDPOINT) || uri.path.startsWith(DESKTOP_ENDPOINT) -> { val platformToken = session.handshakeHeaders[HttpHeaders.AUTHORIZATION]?.firstOrNull()?.toString() ?.removePrefix(PLATFORM_AUTH_PREFIX) ?: throw AuthenticationException("platform credential is null") val (accessKey, secretKey) = String(Base64.getDecoder().decode(platformToken)).split(COLON) diff --git a/support-files/templates/gateway#vhosts#bkrepo.server.conf b/support-files/templates/gateway#vhosts#bkrepo.server.conf index d0c1864a47..80a12de3cb 100644 --- a/support-files/templates/gateway#vhosts#bkrepo.server.conf +++ b/support-files/templates/gateway#vhosts#bkrepo.server.conf @@ -38,12 +38,12 @@ server { # 运营管理后台静态资源网关路径 include vhosts/bkrepo.admin.conf; - # web接口网关路径 - include vhosts/bkrepo.web.conf; - # websocket网关路径 include vhosts/bkrepo.websocket.conf; + # web接口网关路径 + include vhosts/bkrepo.web.conf; + # 后台的网关路径 include vhosts/bkrepo.backend.conf; }