Remove shareable invitation links
Codes are exchanged by copy and paste again. The URL fragment intake, the invitation dialog, the BroadcastChannel answer relay and the Share link / Copy link controls are gone, along with their tests, browser check scenarios and design doc. Code fields no longer accept links. The compressed HC1 codes with typed offers/answers and echoed refs stay. An optional signaling backend is the intended way to simplify the exchange instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f320bfb541
commit
a5935a8324
16 files changed
+57
-602
No files matched your search
+1
-5
@@ -104,10 +104,6 @@ export function waitForIceComplete(pc: IcePeer, { signal, timeout = 30000 }: Wai
|
||||
});
|
||||
}
|
||||
|
||||
export function hasRelay(sdp: string) {
|
||||
return sdp.split(/\r?\n/).some(line => /^a=candidate:.*\styp\s+relay(?:\s|$)/i.test(line));
|
||||
}
|
||||
|
||||
export function validateDescription(sdp: unknown, { allowTurn = false }: Pick<IceOptions, 'allowTurn'> = {}) {
|
||||
if (typeof sdp !== 'string' || sdp.length > MAX_SIGNAL_LENGTH || /[^\x09\x0A\x0D\x20-\x7E]/.test(sdp)) {
|
||||
throw new Error('Invalid connection description.');
|
||||
@@ -122,7 +118,7 @@ export function validateDescription(sdp: unknown, { allowTurn = false }: Pick<Ic
|
||||
if (fingerprints.length !== 1 || !/^a=fingerprint:sha-256 (?:[\da-f]{2}:){31}[\da-f]{2}$/i.test(fingerprints[0])) {
|
||||
throw new Error('A single full SHA-256 fingerprint is required.');
|
||||
}
|
||||
if (!allowTurn && hasRelay(sdp)) {
|
||||
if (!allowTurn && lines.some(line => /^a=candidate:.*\styp\s+relay(?:\s|$)/i.test(line))) {
|
||||
throw new Error('This code contains a TURN relay. Both people must explicitly enable TURN and create new codes to use a relay.');
|
||||
}
|
||||
return fingerprints[0].slice('a=fingerprint:sha-256 '.length).toUpperCase().replaceAll(':', ' ');
|
||||
|
||||
Reference in new issue
Block a user