feat(sub): Add XHTTP session field compatibility in share links and subscriptions (#5929)

*  Add sessionKey and sessionPlacement compatability for previous clients

*  Add sessionKey and sessionPlacement compatability for previous clients on backend
This commit is contained in:
Maksim Alekseev
2026-07-28 23:15:28 +03:00
committed by GitHub
parent ff954ec48c
commit 041476a317
4 changed files with 119 additions and 2 deletions
+9
View File
@@ -2017,6 +2017,15 @@ func buildXhttpExtra(xhttp map[string]any) map[string]any {
}
}
}
// Older clients still read the pre-#6258 names from the subscription
// extra JSON. Emit aliases after lifting legacy inputs so both old and
// new clients can consume the same link.
if v, ok := extra["sessionIDPlacement"].(string); ok && len(v) > 0 {
extra["sessionPlacement"] = v
}
if v, ok := extra["sessionIDKey"].(string); ok && len(v) > 0 {
extra["sessionKey"] = v
}
for _, field := range []string{"uplinkChunkSize"} {
if v, ok := nonZeroShareValue(xhttp[field]); ok {