diff --git a/server/session.go b/server/session.go index be601f8..a644a83 100644 --- a/server/session.go +++ b/server/session.go @@ -801,9 +801,15 @@ func (s *Session) hello(msg *ClientComMessage) { } tenantCode := strings.TrimSpace(msg.Hi.Tenant) - if tenantCode == "" || len(tenantCode) > 64 { + if tenantCode == "" { + // Clients that predate the tenant-aware protocol (stock Tinode + // webapp/mobile SDKs never send this field) fall back to the + // default tenant rather than being rejected. Clients that do + // send an explicit code are unaffected. + tenantCode = "default" + } else if len(tenantCode) > 64 { s.queueOut(ErrMalformed(msg.Id, "", msg.Timestamp)) - logs.Warn.Println("s.hello: tenant code is missing or invalid", s.sid) + logs.Warn.Println("s.hello: tenant code is invalid", s.sid) return } if store.Tenants == nil {