mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
fix(servers): guard stored credentials and reconcile remote session status
Reject a server address change to a new origin unless a password or pairing is supplied, so the stored password is never sent to another host. Test connection now checks the edited values and warns when an origin change needs credentials. Replay and reconcile remote session statuses on stream reconnect and browser resync so linked-server sessions no longer stay busy. Treat malformed server session URLs as not found instead of throwing.
This commit is contained in:
1 parent
3a7227a602
commit
5586120ba2
18 files changed
+843
-62
No files matched your search
@@ -2,3 +2,17 @@
|
||||
export function trimUrlTrailingSlashes(url: string): string {
|
||||
return url.trim().replace(/\/+$/, '')
|
||||
}
|
||||
|
||||
/** Reports whether two URLs share the same origin; false when either URL is invalid. */
|
||||
export function haveSameUrlOrigin(first: string, second: string): boolean {
|
||||
const origin = readUrlOrigin(first)
|
||||
return origin !== null && origin === readUrlOrigin(second)
|
||||
}
|
||||
|
||||
function readUrlOrigin(value: string): string | null {
|
||||
try {
|
||||
return new URL(value).origin
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user