Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(867)

Unified Diff: third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp

Issue 2451763002: Require username and credential for turn/turns (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp
index cec5ec646db74c233a3f9939e7f0c058b77d2a72..4ad8b8a126d72b905f7fb4946d1c4cad25e75fa1 100644
--- a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp
+++ b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp
@@ -315,6 +315,13 @@ WebRTCConfiguration parseConfiguration(ExecutionContext* context,
"\". URL scheme must be \"stun\", \"turn\" or \"turns\".");
return WebRTCConfiguration();
}
+ if ((url.protocolIs("turn") || url.protocolIs("turns")) &&
+ (username.isNull() || credential.isNull())) {
+ exceptionState.throwDOMException(InvalidAccessError,
+ "Both username and credential are "
+ "required when the URL scheme is "
+ "\"turn\" or \"turns\".");
+ }
iceServers.append(WebRTCIceServer{url, username, credential});
}
}

Powered by Google App Engine
This is Rietveld 408576698