This commit is contained in:
Yvan
2026-09-04 14:07:09 +08:00
parent af1e194396
commit 43db5e5450
22 changed files with 416 additions and 134 deletions
+15
View File
@@ -102,6 +102,21 @@ func TestWebSocketRouteSupportsRouterPrefix(t *testing.T) {
t.Fatal("prefixed websocket handshake returned nil connection")
}
_ = connection.Close()
for _, route := range engine.Routes() {
if route.Method == http.MethodGet && route.Path == "/ws" {
t.Fatal("unprefixed websocket route should not be registered")
}
}
found := false
for _, route := range engine.Routes() {
if route.Method == http.MethodGet && route.Path == "/admin/ws" {
found = true
break
}
}
if !found {
t.Fatal("prefixed websocket route was not registered")
}
}
var _ platformws.Hub = (*websocketintegration.Server)(nil)