You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1847e9a
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: apps/android/app/src/main/java/ai/openclaw/app/gateway/GatewaySession.kt
+12-9Lines changed: 12 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1971,9 +1971,7 @@ class GatewaySession(
1971
1971
val scheme = parsed?.scheme ?:"http"
1972
1972
val port = parsed?.port?.takeIf { it >0 } ?:if (scheme.equals("https", ignoreCase =true)) 443else80
1973
1973
val usesFallbackHost = host.isBlank() || isLoopbackGatewayHost(host)
1974
-
val gatewayOrigin ="http://${formatGatewayAuthority(endpoint.host.trim().trimEnd('.'), endpoint.port)}".toHttpUrlOrNull()
1975
-
val surfaceOrigin ="http://${formatGatewayAuthority(host.trimEnd('.'), port)}".toHttpUrlOrNull()
1976
-
val isGatewayAuthority = usesFallbackHost || (gatewayOrigin !=null&& surfaceOrigin == gatewayOrigin)
1974
+
val isGatewayAuthority = usesFallbackHost || endpoint.matchesGatewayAuthority(host, port)
1977
1975
val path = parsed?.rawPath.orEmpty()
1978
1976
val capability = path.removePrefix("/__openclaw__/cap/")
1979
1977
val isRootCapability = path != capability && capability.isNotEmpty() &&!capability.contains('/')
@@ -2174,7 +2172,15 @@ internal fun shouldPauseGatewayReconnectAfterAuthFailure(
2174
2172
}
2175
2173
}
2176
2174
2177
-
/** Builds the gateway WebSocket URL from endpoint authority and TLS policy. */
it =="http://${formatGatewayAuthority(surfaceHost.trim().trimEnd('.'), surfacePort)}".toHttpUrlOrNull()
2181
+
} ==true
2182
+
2183
+
/** Retains pins for the same TLS authority, canonicalizing numeric hosts without adding DNS aliases. */
2178
2184
internalfungatewayTlsFingerprintForCanvasSurface(
2179
2185
fingerprint:String?,
2180
2186
surfaceUrl:String,
@@ -2185,11 +2191,8 @@ internal fun gatewayTlsFingerprintForCanvasSurface(
2185
2191
val surface = runCatching { java.net.URI(surfaceUrl) }.getOrNull() ?:returnnull
2186
2192
if (!surface.scheme.equals("https", ignoreCase =true)) returnnull
2187
2193
val surfaceHost = surface.host?.trim()?.trimEnd('.') ?:returnnull
2188
-
val gatewayHost = endpoint.host.trim().trimEnd('.')
2189
-
val surfacePort = surface.port.takeIf { it >0 } ?:443
0 commit comments