TF-3493 Ensures that a URI always uses wss:// or ws://, helping avoid the error Unsupported URL scheme 'https'
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -30,4 +30,11 @@ extension URIExtension on Uri {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Uri ensureWebSocketUri() {
|
||||
if (scheme == 'ws' || scheme == 'wss') {
|
||||
return this;
|
||||
}
|
||||
return replace(scheme: 'wss');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user