Bug 1815263: Don't warn about a lack of STUN servers if we have a TURN UDP server. r=dbaker

Differential Revision: https://phabricator.services.mozilla.com/D169105
This commit is contained in:
Byron Campen 2023-02-07 19:34:35 +00:00
Родитель d019b30646
Коммит 215043a63d
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -740,7 +740,7 @@ class RTCPeerConnection {
}
urls
.map(url => nicerNewURI(url))
.forEach(({ scheme, spec }) => {
.forEach(({ scheme, spec, query }) => {
if (scheme in { turn: 1, turns: 1 }) {
if (username == undefined) {
throw new this._win.DOMException(
@ -768,6 +768,11 @@ class RTCPeerConnection {
);
}
this._hasTurnServer = true;
// If this is not a TURN TCP/TLS server, it is also a STUN server
const parameters = query.split("&");
if (!parameters.includes("transport=tcp")) {
this._hasStunServer = true;
}
stunServers += 1;
} else if (scheme in { stun: 1, stuns: 1 }) {
this._hasStunServer = true;